Esta es una función muy interesante para escanear puertos.
Private Sub wskTCPWinsock_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim DataStr As String
Dim i As Integer
If chkDoPassiveBannerGrabbing.Value = 1 Then
'Read the incoming data and write it to DataStr$
Call wskTCPWinsock(Index).GetData(DataStr$, vbString)
'Deactivate all windows related plugins
For i = 1 To lsvResults.ListItems.Count
If lsvResults.ListItems.Item(i).SubItems(1) = _
wskTCPWinsock(Index).RemotePort Then
lsvResults.ListItems.Remove (lsvResults.ListItems(i).Index)
End If
Next i
AddPortToList wskTCPWinsock(Index).RemotePort, DataStr
ElseIf chkDoActiveBannerGrabbing.Value = 1 Then
wskTCPWinsock(Index).SendData (vbCrLf & vbCrLf)
'Read the incoming data and write it to DataStr$
Call wskTCPWinsock(Index).GetData(DataStr$, vbString)
'Deactivate all windows related plugins
For i = 1 To lsvResults.ListItems.Count
If lsvResults.ListItems.Item(i).SubItems(1) = _
wskTCPWinsock(Index).RemotePort Then
lsvResults.ListItems.Remove (lsvResults.ListItems(i).Index)
End If
Next i
AddPortToList wskTCPWinsock(Index).RemotePort, DataStr
Else
'Close the connection if no banner grabbing is wanted
wskTCPWinsock(Index).Close
End If
End Sub
La saque de un escaneador de puertos de cvb