1[DllImport("wininet.dll")]
2
3private static extern bool InternetGetConnectedState(ref uint connected, uint reserved);
4
5static uint uConnection = 0x20;
6
7/// <summary>
8
9/// Returns true if it have detected an active Internet connection.
10
11/// </summary>
12
13public static bool HasInternetConnection
14
15{
16
17get { return InternetGetConnectedState(ref uConnection, 0); }
18
19}
20