Sub Button3_Click
Dim p As Phone
Dim sb As StringBuilder, TestIP As String
Dim i As Int
TestIP = "192.168.1.1"
''If TestIP <> "" Then
'' Return
''End If
Try
TestIP = PATUtils.InputBox("Enter IP or blank ALL", "Find IP", "192.168.1.1", "")
If TestIP = "#%$Cancel" Then
Return
Else If TestIP > "" Then
p.Shell( "ping -c 1 -i .2 -w 1 192.168.1."&i,Null,sb,Null)
Log("192.168.1." &i)
Return
End If
If Button3.Text = "Ping" Then
Button3.Text = "Cancel"
Else
Button3.Text = "Ping" : Return
End If
sb.Initialize
For i = 0 To 255
p.Shell( "ping -c 1 -i .2 -w 1 192.168.1."&i,Null,sb,Null)
Log("192.168.1." &i)
DoEvents
If sb.ToString.Contains("transmitted, 1 received") Then Log(sb)
sb.Initialize
If Button3.Text = "Ping" Then Exit
Next
Button3.Text = "Ping"
Msgbox ("Done" ,"")
Catch
ToastMessageShow(LastException.Message,False)
'Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline]
' [-p pattern] [-s packetsize] [-t ttl] [-i interface OR address]
' [-M mtu discovery hint] [-S sndbuf]
' [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination
End Try
End Sub