Posted on 2005-04-20 04:56
黎波 阅读(881)
评论(2) 编辑 收藏 所属分类:
Smart Client
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState( out int connectionDescription, int reservedValue ) ;
/// <summary>
/// Retrieves the connected state of the local system.
/// </summary>
/// <returns>Returns True if there is an Internet connection, or False otherwise.</returns>
public bool IsConnected()
{
int connectionDescription = 0;
return InternetGetConnectedState(out connectionDescription, 0);
}
References:
Microsoft Offline Application Block
WinINetDetectionStrategy.cs