How to determine if a computer is online?

imranf

New member
Joined
Feb 8, 2007
Messages
1
Programming Experience
Beginner
Hi,

I want to determine if a computer is connected to the Internet and thus be able to notify user about it. I tried the ping method and it works but there's one problem, my program becomes dependent on that website for e.g. when I tested my program for pinging www.google.com it showed me reponses but later on they showed "time out" errors may be because the servers can easily choose to ignore sending a response to ping call. :mad:

How do I get around this problem, and find out for sure whether the computer is connected to the Internet or not. I think the program must not be so vulnerable to be dependent on one server.

Any ideas? :eek:
 
Google replies to Ping.
 
Interesting.. Its never worked from any connection I have ever tried, and I dont run outgoing-limiting firewalls.. I normally use microsoft.com ..

Might have to look into that one with the ISPs I use!
 
In .NET framework V2, in addition to the methods in the MY namespace that Neal mentioned, you also have the NetworkAvailabilityChanged event available in the application events, if you are using the application framework.
 
Back
Top