Newbie said:
Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.
Thanks
Dim oPing As New Net.NetworkInformation.Ping
Dim myResponse As Net.NetworkInformation.PingReply
Dim myStatus As New clsStatus()
Try
myResponse = oPing.Send(txtComputername.Text, 8)
If myResponse.Status = NetworkInformation.IPStatus.Success
Then
Catch exPing As Net.NetworkInformation.PingException
'here the computer doesn't have a DHCP Lease anymore
MessageBox.Show("PC not online", "Ping", MessageBoxButtons.OK,
MessageBoxIcon.Information)
Catch ex As Sockets.SocketException
'here the computer is offline but still has a DHCP Lease
MessageBox.Show("PC not online", "Socket", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try