How can I check if Im connected to the internet?
(I may be connected through a modem, LAN, wireless...)
thanks
Printable View
How can I check if Im connected to the internet?
(I may be connected through a modem, LAN, wireless...)
thanks
Try pinging a site like google.
http://msdn2.microsoft.com/en-us/lib...tion.ping.aspx
Also, a lot of other topics have been made recently asking this. You can also view those for related solutions.
You attempt to connect to a remote server. A response of "no route to host / host unreachable" usuallysignifies no connection. The System.Net.Sockets namespace contains all you need.
Why do you want to determine weather there is an Internet connection? If you are going to attempt to make a connection to a remote service it is best to do it all in one go.
have a look at this
I have never been one to recommend pinging a site like google to check for a connection. Simply because; if the application is installed on 500 machines (i.e: easily possible in a corporate environment). The requests would soon get blocked when all of them attempt to ping at once.
Create you own server if you want to do this. :D