"Newbie" <ne****@nospam. comschrieb im Newsbeitrag
news:ej******** ******@TK2MSFTN GP04.phx.gbl...
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.NetworkInfo rmation.Ping
Dim myResponse As Net.NetworkInfo rmation.PingRep ly
Dim myStatus As New clsStatus()
Try
myResponse = oPing.Send(txtC omputername.Tex t, 8)
If myResponse.Stat us = NetworkInformat ion.IPStatus.Su ccess
Then
Catch exPing As Net.NetworkInfo rmation.PingExc eption
'here the computer doesn't have a DHCP Lease anymore
MessageBox.Show ("PC not online", "Ping", MessageBoxButto ns.OK,
MessageBoxIcon. Information)
Catch ex As Sockets.SocketE xception
'here the computer is offline but still has a DHCP Lease
MessageBox.Show ("PC not online", "Socket", MessageBoxButto ns.OK,
MessageBoxIcon. Information)
End Try