请大家帮忙了,为什么无法连接呢?
代码如下:
Private Sub Form_Load()
Me.Show
For I = 1 To 255
Load Winsock1(I)
Next
End Sub
Public Sub ServeOnline(IpPart As String)
Unload SearchConfigue
Dim Socks As Winsock
Dim CNum As Integer
CNum = 1
RunS = True
ExitCode = 0
ServerOnline.Command3.Enabled = False
For Each Socks In ServerOnline.Winsock1
Socks.Close
Next
ServerOnline.Label2.Caption = ServerOnline.Winsock1(0).LocalIP
For Each Socks In ServerOnline.Winsock1
Socks.Connect IpPart + "." + Trim(Str(CNum)), "80"
DoEvents
ServerOnline.Label2.Caption = "扫描:" + IpPart + "." + Trim(Str(CNum))
CNum = CNum + 1
If ExitCode = 1 Then
Exit For
GoTo ExitC
End If
Next
Dim Times As Long
Times = GetTickCount
Do Until GetTickCount - Times > 5000
If ExitCode = 1 Then
ServerOnline.Label2.Caption = "停止成功!"
GoTo ExitC
End If
DoEvents
Loop
ExitC:
For Each Socks In ServerOnline.Winsock1
Socks.Close
DoEvents
Next
RunS = False
ExitCode = 2
ServerOnline.Command3.Enabled = True
End Sub
问题是我在本地机开了80端口,可是程序却无法扫描到.请大家帮忙看错在哪里了?