VB Code:
Private Sub cmdStartScan_Click()
Dim tmpInt As Integer
Dim toIPend As Integer
Dim startIP As Integer
Dim bigNet As String
Dim x As Integer
Dim tmpStr As String
For x = Len(txtToIP) To 1 Step -1
If Mid$(txtToIP, x, 1) = "." Then
toIPend = Mid(txtToIP, x + 1)
Exit For
End If
Next x
For x = Len(txtFromIP) To 1 Step -1
If Mid$(txtFromIP, x, 1) = "." Then
startIP = Mid(txtFromIP, x + 1)
Exit For
End If
Next x
bigNet = Mid$(txtFromIP, 1, x)
For x = startIP To toIPend
lblOnIP.Caption = (bigNet & x)
OpenSocket (bigNet & x)
DoEvents
Next x
For x = 0 To list1.ListCount - 1
tmpStr = Inet1.OpenURL("http://" & list1.List(x) & "index.htm")
If InStr(1, tmpStr, "index.htm", vbTextCompare) Then
list1.AddItem list1.List(x)
End If
DoEvents
Next x
End Sub