VB.net 2003/2005- Can't figure out how to test for working internet connection

  • Thread starter Thread starter adalton
  • Start date Start date
A

adalton

I've been trying to figure out how to test for a valid internet connection.
I am able to connect to a valid internet connection, but when it drops, or
if it is not there when my program starts, I get an exception.

This probably is a newbie question, but I do not even know what or how I
would trap that error.
 
I've been trying to figure out how to test for a valid internet connection.
I am able to connect to a valid internet connection, but when it drops, or
if it is not there when my program starts, I get an exception.

This probably is a newbie question, but I do not even know what or how I
would trap that error.


I ran across this article the other day which you may find useful:
http://www.codeproject.com/vb/net/CC_ConnectionStatePackage.asp

Gene
 
Hello adalton,

I see people ask this a lot.
Who cares if there is a working internet connection. That doesn't tell you
anything. What you really want to know is, "Does the address I want to reach
exist from this location?". So wrap your connection code in a Try/Catch
block and trap any connection failures.

-Boo
 
And what if the user is behind a Proxy ?? :-)

in most company`s people are behind a connectbox , or proxy so ping is only
possible to the local network

i would go for another aproach i would just request a small test page on my
own server , even better you could also implement a so called heartbeat
a background thread just request a page every few seconds this way you can
even detect problems on the network to your server during transfers

regards

Michel Posseth [MCP]
 
Back
Top