|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Internet Accessible?Hi all
How can I find that user is connected to internet or not? thanks in advance 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 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). -- Show quoteHide quoteRegards, 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 > > 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 > > > > > > > > > > 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 > > >
problems typecast,find by function/member name and getting "managed reference"
Call click event via code? C# Registreing assembly/.NET DLLs, EXE SessionEnding Event stops Write access to 'get'-only public property from within a class - best practice? VS studio 2005 versus VS studio 2003 Is that true there are no Linked lists in .NET? Custom Sorting in DataGrid Delegate/Event HELL! Cookies and subdomains and IE6 |
|||||||||||||||||||||||