ping an ip Address

  • Thread starter Thread starter Newbie
  • Start date Start date
N

Newbie

Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.


Thanks
 
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
 
Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.

Thanks

Please open the object browser and search for "ping".

Alternate:

Please open google and search for "ping Visual Basic .NET"

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
Back
Top