📜  检查互联网是否与 c# winforms 连接 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:57.783000             🧑  作者: Mango

代码示例1
[System.Runtime.InteropServices.DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);

public static bool CheckNet()
{
     int desc;
     return InternetGetConnectedState(out desc, 0);         
}