Home All Groups Group Topic Archive Search About
Author
23 Sep 2006 12:17 PM
perspolis
Hi all
How can I find that user is connected to internet or not?

thanks in advance

Author
23 Sep 2006 1:45 AM
Michael Nemtsev
Hello perspolis,

Google first
http://groups.google.com/groups/search?q=dotnet+check+internet, as well as
http://www.codeguru.com/Cpp/I-N/internet/generalinternet/article.php/c3437
sample

p> Hi all
p> How can I find that user is connected to internet or not?
p> thanks 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
Are all your drivers up to date? click for free checkup

Author
23 Sep 2006 6:50 PM
Peter Thornqvist
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

Show quoteHide quote
"Michael Nemtsev" <nemt***@msn.com> skrev i meddelandet
news:1799a79b3aefaf8c8aceaa3823c53@msnews.microsoft.com...
> Hello perspolis,
>
> Google first
> http://groups.google.com/groups/search?q=dotnet+check+internet, as well as
> http://www.codeguru.com/Cpp/I-N/internet/generalinternet/article.php/c3437
> sample
> p> Hi all
> p> How can I find that user is connected to internet or not?
> p> thanks 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
>
>
Author
25 Sep 2006 12:13 PM
Ciaran O''Donnell
This is the check for network connectivity (in .NET 2.0):

System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();

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



Show quoteHide quote
"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" <nemt***@msn.com> skrev i meddelandet
> news:1799a79b3aefaf8c8aceaa3823c53@msnews.microsoft.com...
> > Hello perspolis,
> >
> > Google first
> > http://groups.google.com/groups/search?q=dotnet+check+internet, as well as
> > http://www.codeguru.com/Cpp/I-N/internet/generalinternet/article.php/c3437
> > sample
> > p> Hi all
> > p> How can I find that user is connected to internet or not?
> > p> thanks 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
> >
> >
>
>
>
>
>
>
Author
25 Sep 2006 12:17 PM
Ciaran O''Donnell
You can also handle events with network availability at
System.Net.NetworkInformation.NetworkChange.NetworkAvailabilityChanged
and you can ping webserver to check for connectivity too.
System.Net.NetworkInformation.Ping

HTH

Ciaran O'Donnell


Show quoteHide quote
"perspolis" wrote:

> Hi all
> How can I find that user is connected to internet or not?
>
> thanks in advance
>
>
>



Post Thread options