473,804 Members | 3,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

internet connection

Fei
Hi,

I have a question about internet connection. I have my application
running in WindowsXP pro. How can I make my application raise a messagebox
when the internet connection goes down? Please help me out.

Thanks !

Fei
Nov 20 '05 #1
2 1040
You would have to Ping your Gateway at an intervall I guess.. and if that
times out you could asume you are not connected anymore!

So you have to find out how to ping.. and then just do that every minute or
so with a Timer.

/Try Guy
"Fei" <fw***@NOSPAMcs ystemssoftware. com> skrev i meddelandet
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Hi,

I have a question about internet connection. I have my application
running in WindowsXP pro. How can I make my application raise a messagebox when the internet connection goes down? Please help me out.

Thanks !

Fei

Nov 20 '05 #2
Since you mention Internet, I'm going to assume you are not talking about your
Network.
You might be able to get away with this pinging the Gateway, maybe not.
Depending upon your network infrastructure, it is entirely possible that your
gateway would be alive and well but not your external connection. So the more
reliable method would be to contact an external server.
However, you might need to know the specifics of the external connection as
well.
Many firewalls and/or routers will not respond to or pass along ICMP Ping
requests.
In addition, over a period of time the firewall might interpret the high volume
of pings to be a pre-cursor to a Denial Of Service attack and might stop
responding to your pings. Worst yet, it might add your IP to a blacklist.

Gerald

"Try Guy" <no****@no.no > wrote in message
news:ea******** ******@tk2msftn gp13.phx.gbl...
You would have to Ping your Gateway at an intervall I guess.. and if that
times out you could asume you are not connected anymore!

So you have to find out how to ping.. and then just do that every minute or
so with a Timer.

/Try Guy
"Fei" <fw***@NOSPAMcs ystemssoftware. com> skrev i meddelandet
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Hi,

I have a question about internet connection. I have my application
running in WindowsXP pro. How can I make my application raise a

messagebox
when the internet connection goes down? Please help me out.

Thanks !

Fei


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
3669
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 either in "online" or "offline" mode (it keeps a cache of downloaded info, so it can work without a connection if needed). The basic problem is this: it downloads info (RSS feeds) from a variety of sources. Any one (or more) of these could...
6
2590
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 HttpWebRequest and point it to the specified URL I wish to connect to later on, and if that throws an error, I know I don't have an internet connection. Is this the best method for detecting an internet connection, or is there some sort of routine that I need...
4
2810
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 connected or not). I'm not interested in speed detection or any other aspect of the connection, just its existence or not. The reason is to be able to intercept link clicks on a CD-based set of HTML pages and pop up a warning if there is no...
8
3286
by: Jozef | last post by:
Hello, Is there a way to test that an internet connection exists and that you are able to see the webserver before performing any connections? The reason being, when I try to connect to an SQL database it takes sooo long to time out if the connection isn't available. If a user is on a dial up connection, I'd like to be able to determine that quickly, then ask the user if they would like to connect for current information otherwise rely...
3
6643
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
0
3629
by: Paul Johnson | last post by:
I have not found code that can successfully opena dn close a connection, so I created the class below. It will open, disconnect and check the type of internet connection you have. Paul R. Johnson using System; using System.Collections; using System.Data;
0
1396
by: Arthur | last post by:
Hi, I am trying to write a windows service in VC++.NET 2003, the task of this server is to detect the kind of internet connection and if there is a connection send some file and do something. I have found a method calls InternetGetConnectedState() in .net, this returns false or true for connection also this one has flags and you can use them to know what kind of connection machine uses. But here is my problem: suppose you don't have...
3
4050
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 working. here is what ive done i gave up on using dhcp addressing between the host and client as this wasnt working so i tried using static ip's instead. the host and the server are connected by a wired connection (through a switch). the host is...
6
3142
by: =?Utf-8?B?QnNtZW5nZW4=?= | last post by:
I am trying to make sure that the local connection is up. I have presently been using the NetworkChange.NetworkAvailabilityChanged Event for this. Is there a better way to do this? Also, I want to test to see if the Internet Connection is up. I need the Internet to be up for the Web Services I am calling. Is it better to test the Internet Connection through Pinging an IP Address (I presently do 3 ping failures for it to be down) or...
1
2269
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 as a virtual machine
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10076
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.