By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,314 Members | 1,745 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,314 IT Pros & Developers. It's quick & easy.

How to test internet connection in VB.NET?

P: n/a
Hello,

I have an application that runs continously gives an error and stops working
if the internet goes down (which happens for about 5-10 minutes several times
a day. Can anybody tell me how to test for internet connectivity when this
happens and then pause processing until internet connectivity is back up?

Thanks.
May 30 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Tue, 30 May 2006 15:12:02 -0700, John Riddle wrote:
I have an application that runs continously gives an error and stops working
if the internet goes down (which happens for about 5-10 minutes several times
a day. Can anybody tell me how to test for internet connectivity when this
happens and then pause processing until internet connectivity is back up?


Open a connection to a server garanteed to be up 24/7 such as
microsoft.com, apple.com or google.com. If the connection succeeds, your
Internet connection is up. If it fails, you might want to try out another
site first before declaring that the connection has been lost though.
May 30 '06 #2

P: n/a

"John Riddle" <Jo********@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.com...
I have an application that runs continously gives an error and stops
working
if the internet goes down (which happens for about 5-10 minutes several
times
a day. Can anybody tell me how to test for internet connectivity when this
happens and then pause processing until internet connectivity is back up?


Maybe shell 'ping' and see what happens?

May 31 '06 #3

P: n/a
John,

Try the first IP next after your router.

http://msdn2.microsoft.com/en-us/lib...tion.ping.aspx

http://msdn2.microsoft.com/en-us/library/he5sca5t.aspx

I hope this helps,

Cor

"John Riddle" <Jo********@discussions.microsoft.com> schreef in bericht
news:7E**********************************@microsof t.com...
Hello,

I have an application that runs continously gives an error and stops
working
if the internet goes down (which happens for about 5-10 minutes several
times
a day. Can anybody tell me how to test for internet connectivity when this
happens and then pause processing until internet connectivity is back up?

Thanks.

May 31 '06 #4

P: n/a
Thanks guys. Tried Mehdi's response and it worked great.

Thanks.
Try

"Mehdi" wrote:
On Tue, 30 May 2006 15:12:02 -0700, John Riddle wrote:
I have an application that runs continously gives an error and stops working
if the internet goes down (which happens for about 5-10 minutes several times
a day. Can anybody tell me how to test for internet connectivity when this
happens and then pause processing until internet connectivity is back up?


Open a connection to a server garanteed to be up 24/7 such as
microsoft.com, apple.com or google.com. If the connection succeeds, your
Internet connection is up. If it fails, you might want to try out another
site first before declaring that the connection has been lost though.

May 31 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.