Connecting Tech Pros Worldwide Forums | Help | Site Map

How to ping another computer in Vb 2005

=?Utf-8?B?bWFydGluMQ==?=
Guest
 
Posts: n/a
#1: Mar 7 '07
Hi, All,

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

Thanks in advance,
Martin
susiedba@hotmail.com
Guest
 
Posts: n/a
#2: Mar 7 '07

re: How to ping another computer in Vb 2005


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




On Mar 7, 11:56 am, martin1 <mart...@discussions.microsoft.comwrote:
Quote:
Hi, All,
>
I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?
>
Thanks in advance,
Martin

rowe_newsgroups
Guest
 
Posts: n/a
#3: Mar 7 '07

re: How to ping another computer in Vb 2005


On Mar 7, 2:56 pm, martin1 <mart...@discussions.microsoft.comwrote:
Quote:
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

ShaneO
Guest
 
Posts: n/a
#4: Mar 7 '07

re: How to ping another computer in Vb 2005


martin1 wrote:
Quote:
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.
=?Utf-8?B?S2VycnkgTW9vcm1hbg==?=
Guest
 
Posts: n/a
#5: Mar 7 '07

re: How to ping another computer in Vb 2005


Martin,

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

Kerry Moorman


"martin1" wrote:
Quote:
Hi, All,
>
I try to ping another PC using ping in vb 2005, can anyone provide a snippet
of code?
>
Thanks in advance,
Martin
Freddy Coal
Guest
 
Posts: n/a
#6: Mar 8 '07

re: How to ping another computer in Vb 2005


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

Thanks in advance.

Freddy Coal

"ShaneO" <spcacc@optusnet.com.auwrote in message
news:45ef2248$0$9771$afc38c87@news.optusnet.com.au ...
Quote:
martin1 wrote:
Quote:
>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.

Closed Thread