Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Verify interet connection
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01126557
Message ID:
01126561
Views:
25
This message has been marked as a message which has helped to the initial question of the thread.
Dawa,
I used this method in 1.1:
using System ;
using System.Runtime ;
using System.Runtime.InteropServices ; 
public class InternetCS
{
  [DllImport("wininet.dll")]
  private extern static bool InternetGetConnectedState( out int Description, int ReservedValue ) ;

  public static bool IsConnectedToInternet( )
  {
    int Desc ;
    return InternetGetConnectedState( out Desc, 0 );
  }
}
If you don't want to use "old" DLLs and stay with managed code you could us the new Ping class introduced in 2.0. You could try to ping a server that is "always" up (like cnn.com or levelextreme.com). I looked briefly at the Ping examples in the M$ docs and the examples look good.

HTH,
Einar

>Hi all,
>
>How do verify the existence of a live connection to the internet from the computer that is running my application?
>
>TIA
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform