473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to test internet connection in VB.NET?

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
4 8439
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

"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Cliff Wells | last post by:
Hi, I'm writing an application that needs to know if an Internet connection is available. Basically, I want to have something similar to what a lot of email clients have, where the app can work...
6
by: Matt Hawley | last post by:
I'm facing a problem where I need to verify that my windows forms application has access to the internet before it can do anything. Currently, the only way I can think of is by creating a...
4
by: Peter Flynn | last post by:
I'm having trouble finding example code to detect the presence of an Internet connection. It doesn't seem to be a very frequently asked question, as all I need is the answer yes or no (is the user...
3
by: Jonny | last post by:
Hi, Please could you tell me how to check for an internet connection in C. I'm using Windows 2000. Many Thanks, Jonny
1
by: Ricardo Luceac | last post by:
HI... I'm making a program to test f my connection to the internet was alive... I think of make a webrequest and ersponse, but even if my connection is down doesn't I get a response??? The error...
15
by: ezmiller | last post by:
Does anybody know how to use javascript to test whether or not an internet connection exists? Is this possible even?
4
by: adalton | last post by:
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...
3
by: danielmcinerney | last post by:
i am trying to set up internet connection sharing between a vista machine (host) and an XP machine (client). i have followed guidelines from various pages on the internet but i still cannot get it...
1
by: =?Utf-8?B?QiBTaW5naA==?= | last post by:
Hi Scenario 1) Host - XP Laptop with internet connection using Sky Broadband Wireless Router Netgear DG834GT 2) MS Virtual Server 2005 - I have deployed an XP MS Virtual Server 2005 to act...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.