Private Sub Command1_Click()
List1.Clear
If Text2.Text = "" Or Text3.Text = "" Then
MsgBox "没有端口扫什么扫啊!" & vbCrLf & "输入从1到65535的端口号。", 0 + 48, "端口号不能为空!"
ElseIf Text2.Text > "65535" Or Text3.Text > "65535" Then
MsgBox "没有这么大的端口号的!" & vbCrLf & "正确的端口号从1到65535。", 0 + 48, "端口号错了!"
End If
Winsock1.Close
Start = True
Call SCanningPorts '调用自定义过程
List1.AddItem "端口" & Text2.Text & "-" & Text4.Text & "已扫描完成!" '扫描结束了
List1.Text = List1.List(List1.NewIndex)
End Sub
1