-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm4.frm
133 lines (106 loc) · 2.95 KB
/
Form4.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form4
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "SendMail Info"
ClientHeight = 3195
ClientLeft = 4275
ClientTop = 4110
ClientWidth = 4680
Icon = "Form4.frx":0000
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
Begin VB.Timer Timer2
Left = 3840
Top = 360
End
Begin VB.CommandButton Command1
BackColor = &H00E0E0E0&
Caption = "Send"
Height = 255
Left = 120
Style = 1 'Graphical
TabIndex = 2
Top = 480
Width = 2535
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
Height = 285
Left = 120
TabIndex = 1
Text = "192.168.0.3"
Top = 120
Width = 2535
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
Height = 2295
Left = 120
MultiLine = -1 'True
TabIndex = 0
Top = 840
Width = 4455
End
Begin VB.Timer Timer1
Left = 3120
Top = 120
End
Begin MSWinsockLib.Winsock Winsock1
Left = 4200
Top = 120
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 3000
Winsock1.RemoteHost = Text1.Text
Winsock1.RemotePort = 25
Winsock1.Connect
End Sub
Private Sub Form_Load()
Text1.Text = Form1.Text1.Text
End Sub
Private Sub Timer1_Timer()
Winsock1.Close
Text2.Text = "Server Temporally Down, Or Port Not Open"
Alert = MsgBox("Time out" & vbNewLine & "Maybe the server isn't running this service?", vbExclamation, "Error")
Timer1.Enabled = False
End Sub
Private Sub Timer2_Timer()
Winsock1.Close
Timer2.Enabled = False
End Sub
Private Sub Winsock1_Connect()
'winsock connect
Dim Query As String
Form2.Caption = "Connected"
'Query = "GET / HTTP/1.0" & vbCrLf & vbCrLf
'Query = "242424gd" & vbCrLf & vbCrLf
Query = ""
Winsock1.SendData Query
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
'winsock arrival
On Error Resume Next
Dim WebData As String
Winsock1.GetData WebData, vbString
Text2.Text = Text2.Text + WebData
Timer1.Enabled = False
Timer2.Enabled = True
Timer2.Interval = 1500
End Sub