记录备用
1 using System.Net.NetworkInformation;
2 bool bNetOK = NetworkInterface.GetIsNetworkAvailable();
2 bool bNetOK = NetworkInterface.GetIsNetworkAvailable();
补充
bool IsExistNet()
{
if(NetworkInterface.GetIsNetworkAvailable())
{
if(NetworkInterface.NetworkInterfaceType==NetworkInterfaceType.None)
{return false;}
return true;
}
return false;
}