Web Connection Test

  • Thread starter Thread starter Dennis C. Drumm
  • Start date Start date
D

Dennis C. Drumm

Is there a way for a Windows Form application to determine if the computer
it is running on is currently connected to the internet and not just a local
network?

Thanks,

Dennis
 
There really isn't a good or bullet-proof means to check for
connectivity to the Internet. The best that you can do is try to make
a low-overhead connection to a set of well-known, high availability
servers, such as yahoo.com, google.com, etc.

Since many sites don't respond to ping anymore, it may be your bets bet
to make an HTTP HEAD request for index.html and see if ti comes back
with an HTTP status code of 200.
 
Back
Top