Connecting Tech Pros Worldwide Forums | Help | Site Map

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

adalton
Guest
 
Posts: n/a
#1: Oct 12 '06
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.

Stacey
Guest
 
Posts: n/a
#2: Oct 12 '06

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


Look into Ping
http://msdn2.microsoft.com/en-us/lib...ng(VS.80).aspx

just ping a known ip address and see if it is reachable.
"adalton" <adalton@newsdalton.comwrote in message
news:eglhmi02dj3@news1.newsguy.com...
Quote:
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.

gene kelley
Guest
 
Posts: n/a
#3: Oct 13 '06

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


On 12 Oct 2006 13:58:42 GMT, adalton <adalton@newsdalton.comwrote:
Quote:
>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...atePackage.asp

Gene
GhostInAK [Bastard]
Guest
 
Posts: n/a
#4: Oct 13 '06

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


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
Quote:
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.
>

Michel Posseth [MCP]
Guest
 
Posts: n/a
#5: Oct 14 '06

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


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]


"Stacey" <StaceyL@community.nospamschreef in bericht
news:eoUWKTj7GHA.3280@TK2MSFTNGP02.phx.gbl...
Quote:
Look into Ping
http://msdn2.microsoft.com/en-us/lib...ng(VS.80).aspx
>
just ping a known ip address and see if it is reachable.
"adalton" <adalton@newsdalton.comwrote in message
news:eglhmi02dj3@news1.newsguy.com...
Quote:
>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.
>
>

Closed Thread