Question continuous ping

sharief

New member
Joined
Dec 30, 2011
Messages
2
Programming Experience
Beginner
dear all ,
i am gonna write a program that does a continuous ping.exe command to several switches. i want the program to sense the result from the ping command and does something in the case of " Reply " and does another something in the case of " request time out"
the main purpose of my program is to check the status of my network all the time and not on demand .
my idea was like that :
i put a plane with default color green if the result from the ping command is " reply " and the color will change to red if the connection is lost .
i use a code but the ping command was done for one time and give me green while the network connection is lost and the program did not sense this change.
i want the program to sense the connection all the time not on demand like clicking a button or checking check box .. etc .
can any body help me .
thank you.
 
Last edited by a moderator:
First up, please provide meaningful titles for your threads. Everyone who posts wants help so your title is no better than no title at all. The title is supposed to give us an idea of what the thread is about. Without it, we would have to open every single thread to find out what it's about, which is a big waste of our time.

As for the question, you don't need to use ping.exe. .NET has its own Ping class, so you should use that. Having said that, continually pinging is probably not the way to go. A VB WinForms application has a NetworkAvailabilityChanged event that will tell if the application loses or gains network availability. Strictly speaking, access to the network and access to the internet are not the same thing, but it's effectively the same thing most of the time and should be enough for most apps.
 
Back
Top