473,396 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ping an ip Address

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

Sep 19 '08 #1
4 2203

"Newbie" <ne****@nospam.comschrieb im Newsbeitrag
news:ej**************@TK2MSFTNGP04.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.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

Sep 19 '08 #2
On Sep 19, 3:27*am, "Newbie" <new...@nospam.comwrote:
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/
Sep 19 '08 #3
Newbie,

You can use Visual Basic's My.Computer.Network.Ping method.

Kerry Moorman
"Newbie" wrote:
Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.
Thanks

Sep 19 '08 #4
On Sep 19, 10:27*am, "Newbie" <new...@nospam.comwrote:
Is it possible, without any 3rd party tools to simply ping an ip address,
and get back if the ping was sucessfull.

Thanks
As Kerry pointed out, you can use My.Computer.Network.Ping method
which returns a Boolean as True if pinging was successful.

See more for usage:
http://msdn.microsoft.com/en-us/libr...5t(VS.80).aspx

HTH,

Onur Güzel
Sep 22 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: techprot-google04 | last post by:
I've found tons of sample code on pinging - but all start with the host name, resolve the ip address and do the ping. Does anyone have any sample code that does a ping from an ip address alone?...
2
by: Devin | last post by:
I am trying to figure out a way to ping IP address. This is because we assign all of our IP address in house, and when we are assigning a new one, we wish to verify that it is not already in use....
0
by: Ed | last post by:
I've attached some VB.NET code I've hacked together (some taken from MS examples & newsgroup postings) that will perform a ping or IcmpSendEcho using the icmp.dll (see this for more info:...
2
by: Ryan | last post by:
I want to ping every IP on a subnet (255 IP's) and display in a table what IP's are active. I'm currently using a For loop but this takes forever because it pauses to test each Ping. So my guess...
5
by: Deepak | last post by:
I am programing a ping application which pings various centers . I used timer loop and it pings one by one. Now when i finish pinging one center it should wait for the ping_completed function to...
1
by: Krish | last post by:
All, I have an offline application that works online for some data syncronization. For data syncronization I access a webservice. I want to show whether my application is online or not by checking...
5
by: Michael M. | last post by:
I have the following code (listed at bottom of post) that pings a small range of IP address to see which ones are alive. To speed things up a little I am trying to use more than one thread,...
4
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all I need a simple program that allows me to check if an IP address is pingable. I am not going to send/receive anything to the remote host, just check if it is visible. Something like...
6
by: Dave Marden | last post by:
I currently use this routine in vbscript to ping computers and get the status of ping to determine whether to try to backup a machine, I am trying to change it to work with vb2003.net I am...
6
by: belias | last post by:
So...here we go. I'm having an issue with one computer on a network not being able to ping other computers by name. I've spent the last day searching similar issues and I've tried all the steps...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.