Запускаем басик -> начинаем новый проект -> на форму кидаем компоненты: Label, TextBox, WinSock, Button, StatusBar. Ну и начинаем кодить ;)
Private Sub Command1_Click() Dim Socket As Variant Dim CurrentPort As Integer Const MaxSockets = 100 On Error Resume Next If Command1.Caption = "Start" Then txtHost.Enabled = False txtPortStart.Enabled = False txtPortEnd.Enabled = False Command1.Caption = "Stop" For i = 1 To MaxSockets Load Sock(i) Next i CurrentPort = txtPortStart.Text While Command1.Caption = "Stop" For Each Socket In Sock DoEvents If Socket.State <> sckClosed Then GoTo continue End If Socket.Close If CurrentPort = Val(txtPortEnd.Text) + 1 _ Then Exit For Socket.RemoteHost = txtHost.Text Socket.RemotePort = CurrentPort Status.SimpleText = "Now Scanning Port " & CurrentPort Socket.Connect CurrentPort = CurrentPort + 1 continue: Next Socket Wend Command1.Caption = "Start" txtHost.Enabled = True txtPortStart.Enabled = True txtPortEnd.Enabled = True Else Command1.Caption = "Start" End If For i = 1 To MaxSockets Unload Sock(i) Next i End Sub Private Sub Form_Load() End Sub Private Sub FoundPorts_Change() FoundPorts.SelStart = Len(FoundPorts.Text) End Sub Private Function AddPort(Port As Integer) FoundPorts.Text = FoundPorts.Text & "[Connected] Port " & Port & vbCrLf End Function Private Sub Sock_Connect(Index As Integer) AddPort (Sock(Index).RemotePort) Sock(Index).Close End Sub Private Sub Sock_Error(Index As Integer, 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) Sock(Index).Close End SubДалее компилим, ну и все - радуемся жизни B)
p.s. Для тех кому не нравится бэйсик, берем делфи и переписываем это все дело на делфи... не так уж и сложно ;)