PDA

Click to See Complete Forum and Search --> : How do I ping from VB.Net


dogboydelta
Sep 3rd, 2005, 01:26 PM
Hi, I know this is probably a dumb question, but I just want to do a simple
ping from my application and store the result. I looked in System.Net and
can't seem to find an object or method. Can someone help me?

Thanks!

shred444
Sep 6th, 2005, 10:09 AM
I am also looking for an answer to this question...thanks

dglienna
Sep 6th, 2005, 10:19 PM
I found this for both of you

http://www.dart.com/pingdotnet.asp

dee-u
Sep 6th, 2005, 11:13 PM
I found this (http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=3194&lngWId=10) for both of you.

daviddoria
Jul 29th, 2009, 04:39 PM
I realize this is 3 years old, but it is the first thing that google turned up, so I thought I'd add what I found. This seems like the way to go:


If My.Computer.Network.Ping("192.168.0.152") Then
MsgBox("success")
Else
MsgBox("no reply")
End If


Dave

Hack
May 26th, 2010, 06:24 AM
When I put my own IP address into Whoisxy, it came back with "Bad host name or IP address" and I know that isn't true.

dbasnett
May 28th, 2010, 11:10 AM
@dogboy - why are you wanting to ping?

TCarter
May 28th, 2010, 12:15 PM
@dogboy - why are you wanting to ping?

you do realize this post is like..5 years old right?

Regardless, Pinging is used for multiple reasons.

1. If you are using proxies, you want to make sure it has low latency so it doesnt lag your software tremendously.

2. To make sure a net service is..ONLINE.

dbasnett
May 28th, 2010, 12:41 PM
you do realize this post is like..5 years old right?

Regardless, Pinging is used for multiple reasons.

1. If you are using proxies, you want to make sure it has low latency so it doesnt lag your software tremendously.

2. To make sure a net service is..ONLINE.

Really? Try this test:

1. Close your browser
2. Get a DOS Prompt
3. Ping www.vbforums.com

when you get one successful reply come back to this thread and post the results.

stateofidleness
Jun 1st, 2010, 12:52 PM
deja vu

dbasnett
Jun 1st, 2010, 03:21 PM
all over agian ;)

megatrontheman
Jul 6th, 2010, 03:46 AM
Really? Try this test:

1. Close your browser
2. Get a DOS Prompt
3. Ping www.vbforums.com

when you get one successful reply come back to this thread and post the results.

I know this is 5 yr old post but hey i just wanted to put my penny in on dbasnett post to make sure you get the right results :-

Example 1
Server is most likely up and behind firewall. (DNS to IP is working)

Ping reply :-
Pinging www.vbforums.com [63.236.73.220] with 32 bytes of data:
Request timed out.

Example 2
Server is pingable.

Pinging rasangroup.com [174.122.250.34] with 32 bytes of data:
Reply from 174.122.250.34: bytes=32 time=266ms TTL=48

Example 3
Server is nowhere to be found. (DNS to ip cannot be resolved)

ping ksksksksks.com
Ping request could not find host ksksksksks.com. Please check the name and try again.

Reason of this post? well you know what to look for if you are relying on ping reply and what different result means. I probably missed out alot of other results from ping but these are probably most common ones.