How to ping another computer in Vb 2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?

Thanks in advance,
Martin
 
well you can do it via the command line and the SHELL command...
right?

you could pipe this into a text file; and then you wouldn't have any
external dependencies

this way you can also get multiple ping values; that's more important
than a single value

if that doesn't work i'd check out www.freevbcode.com
 
Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?

Thanks in advance,
Martin

Search for "ping" in the object browser - there are several methods to
do this.

Thanks,

Seth Rowe
 
martin1 said:
Hi, All,

I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?

Thanks in advance,
Martin

OK, some very rough code (that works) -

Imports System.Net.NetworkInformation

Dim Ping As New Ping
Dim PingOptions As New PingOptions
PingOptions.Ttl = 64
Dim PingReply As PingReply = Ping.Send("192.168.1.1", 500)
If PingReply.Status = IPStatus.Success Then
'Do Something...
End If

Hope this is enough to get you started.

Also, look up PING in the on-line help.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
 
Martin,

In addition to the other responses, VB 2005 offers My.Computer.Network.Ping.

Kerry Moorman
 
You know how I can make a Ipconfig for get my own IP, and the data of my
NetCard.

Thanks in advance.

Freddy Coal
 
Back
Top