是否连网

        [DllImport("wininet")]

        private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);

c#自带的Ping,using System.Net.NetworkInformation;
Ping ping = new Ping();

PingReply reply = ping.Send(ip, 100);
if (reply.Status == IPStatus.Success)
{

猜你喜欢

转载自www.cnblogs.com/erist/p/10112725.html