473,508 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Internet Accessible?

Hi all
How can I find that user is connected to internet or not?

thanks in advance
Sep 23 '06 #1
4 2175
Hello perspolis,

Google first
http://groups.google.com/groups/sear...check+internet, as well as
http://www.codeguru.com/Cpp/I-N/inte...icle.php/c3437
sample

pHi all
pHow can I find that user is connected to internet or not?
pthanks in advance
p>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 23 '06 #2
Is there an equivalent to InternetCheckConnection in .Net? If not, why not
interop it?

Here's another alternative:

using System.Net;

HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(@"http://www.microsoft.com");
An exception indicates that the site isn't reachable thus probably there is
no internet connection (ms site could be down as well, but that is not as
probable).
--
Regards, Peter

"Michael Nemtsev" <ne*****@msn.comskrev i meddelandet
news:17***************************@msnews.microsof t.com...
Hello perspolis,

Google first
http://groups.google.com/groups/sear...check+internet, as well as
http://www.codeguru.com/Cpp/I-N/inte...icle.php/c3437
sample
pHi all
pHow can I find that user is connected to internet or not?
pthanks in advance
p---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche



Sep 23 '06 #3
This is the check for network connectivity (in .NET 2.0):

System.Net.NetworkInformation.NetworkInterface.Get IsNetworkAvailable();

This will tell you only if you are connected to something (network, dialup,
wireless etc), not whether the internet is contactable. The best bet is to
try and do what you want to do and handle any exceptions, or try and open
something like google for microsoft to check for connectivity.

HTH

Ciaran O'Donnell

"Peter Thornqvist" wrote:
Is there an equivalent to InternetCheckConnection in .Net? If not, why not
interop it?

Here's another alternative:

using System.Net;

HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(@"http://www.microsoft.com");
An exception indicates that the site isn't reachable thus probably there is
no internet connection (ms site could be down as well, but that is not as
probable).
--
Regards, Peter

"Michael Nemtsev" <ne*****@msn.comskrev i meddelandet
news:17***************************@msnews.microsof t.com...
Hello perspolis,

Google first
http://groups.google.com/groups/sear...check+internet, as well as
http://www.codeguru.com/Cpp/I-N/inte...icle.php/c3437
sample
pHi all
pHow can I find that user is connected to internet or not?
pthanks in advance
p---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche



Sep 25 '06 #4
You can also handle events with network availability at
System.Net.NetworkInformation.NetworkChange.Networ kAvailabilityChanged
and you can ping webserver to check for connectivity too.
System.Net.NetworkInformation.Ping

HTH

Ciaran O'Donnell
"perspolis" wrote:
Hi all
How can I find that user is connected to internet or not?

thanks in advance
Sep 25 '06 #5

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

Similar topics

8
3275
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...
1
1428
by: Linno Hak | last post by:
Hi all, I've written an ASP.NET application that is running fine on the Intranet. I'd like to make this application accessible via the Internet. Can anyone please recommend any good book or...
12
3040
by: Paul Tillotson | last post by:
At my company we are looking at deploying clients for our client/server app outside our firewall, which will then require our postgres box to be internet-accessible. Does anyone out there have...
5
1252
by: asdf | last post by:
Hi, Currently, I have one database for Intranet clients on the server behind the firewall. But I was asked to allow the extranet users to access the same data. From the security perspective what...
7
1955
by: Visitor No 3 | last post by:
My local Crinkles group(U3A), of which I am one, want me to develop a noddy database and web site for their members. Some are computer literate, others not so. I thought an Access 2000 .mdb on a...
1
1318
by: staeri | last post by:
I have a web application developed in ASP.NET 2.0 with SQL Server 2005. The application is on a hosted server accessible from Internet. I have a potential customer who insists on having the...
0
1864
by: doron.grinstein | last post by:
A lot of architects tackle the issue of exposing internal web services and web applications to the Internet. How many times do you see a requirement such as "the application should be accessible to...
2
1955
by: =?Utf-8?B?Sm9zZXBo?= | last post by:
I am building an ASP.Net 2.0 application that will be accessible through both internet and intranet. The application will use two different types of security methods, depending on whether the...
4
3719
by: Umenzi | last post by:
I'm looking for different methods of disabling all internet access that work on XP and Vista. It would need to be reversible. Preferably, these methods would be accessible through a python program...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
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...
0
7336
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,...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
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...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3211
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...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.