Im trying to do a simple Loop where by an IP address is pinged (Using My.computer.network.ping) and the results, true or false, are used to invoke another line of code.
Basically if the IP is pingable (true) image A is displayed if it is not (false) then image B is.
The code i am using is as follows
Expand|Select|Wrap|Line Numbers
- Dim IPAddress As String = "192.168.1.122"
- If My.Computer.Network.Ping(IPAddress) = False Then
- Do Until True
- Loop
- PictureBox1.Visible = True
- Else
- PictureBox2.Visible = True
- End If
- End Sub
Im new to VB.NET environment so any suggestions or advice you can give would be great.
Thanks in advance
Sy