How to detect Internet connection on machine?
-
I am using CWebBrowser2 wrapper in my dialog based application. In the OnInitDialog() function I am calling Navigate() function of CWebBrowser2. If the internet connection is not available on a machine then how can I generally detect that so that I can display some default thing in CWebBrowser2 control. Can it be detected using CWebBrowser2 ? Thanks.
-
I am using CWebBrowser2 wrapper in my dialog based application. In the OnInitDialog() function I am calling Navigate() function of CWebBrowser2. If the internet connection is not available on a machine then how can I generally detect that so that I can display some default thing in CWebBrowser2 control. Can it be detected using CWebBrowser2 ? Thanks.
-
I am using CWebBrowser2 wrapper in my dialog based application. In the OnInitDialog() function I am calling Navigate() function of CWebBrowser2. If the internet connection is not available on a machine then how can I generally detect that so that I can display some default thing in CWebBrowser2 control. Can it be detected using CWebBrowser2 ? Thanks.
-
I am using CWebBrowser2 wrapper in my dialog based application. In the OnInitDialog() function I am calling Navigate() function of CWebBrowser2. If the internet connection is not available on a machine then how can I generally detect that so that I can display some default thing in CWebBrowser2 control. Can it be detected using CWebBrowser2 ? Thanks.
-
At least you can realize a ping on a specific server. Propably the CWebBrowser2 has this function... Good luck
baerten wrote:
At least you can realize a ping on a specific server.
Pinging a machine is not reliable. Too many false-positives.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
I am using CWebBrowser2 wrapper in my dialog based application. In the OnInitDialog() function I am calling Navigate() function of CWebBrowser2. If the internet connection is not available on a machine then how can I generally detect that so that I can display some default thing in CWebBrowser2 control. Can it be detected using CWebBrowser2 ? Thanks.
ccpptrain wrote:
If the internet connection is not available on a machine then how can I generally detect that...
See if this helps.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
baerten wrote:
At least you can realize a ping on a specific server.
Pinging a machine is not reliable. Too many false-positives.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
baerten wrote:
At least you can realize a ping on a specific server.
Pinging a machine is not reliable. Too many false-positives.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
DavidCrow wrote:
Pinging a machine is not reliable. Too many false-positives.
You mean false-negatives? ICMP-requests to a live server filtererd out by a firewall? You need to pick a server with ICMP running and not prone to stop that. I use "www.heise.de" for that. A german publisher of computer magazins with a very dedicated opinion on why ICMP-filterung is bad.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
George Orwell, "Keep the Aspidistra Flying", Opening words -
DavidCrow wrote:
Pinging a machine is not reliable. Too many false-positives.
You mean false-negatives? ICMP-requests to a live server filtererd out by a firewall? You need to pick a server with ICMP running and not prone to stop that. I use "www.heise.de" for that. A german publisher of computer magazins with a very dedicated opinion on why ICMP-filterung is bad.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
George Orwell, "Keep the Aspidistra Flying", Opening wordsjhwurmbach wrote:
You mean false-negatives?
Thanks. :-O
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
That's right, but in case of no internet connection you have all the time a false result. But it's anyway the latest possibility LOL
If you have a dial-up, the attempt to query an IP will cause the ISP authentication junk (dialog boxes) to kick in. We tried this back in 2002 and soon realized it caused too many issues on laptops that needed to connect at locations with modems but weren't connected at the time the software was being run. You need to check the routing table, then maybe attempt a ping after you know there is some network connection. There are a couple of different approaches to check for network connectivity before attempting to go out and touch another computer.