在使用时,先引用 using System.Net.NetworkInformation;
Ping pingSender = new Ping(); PingReply reply = pingSender.Send("127.0.0.1"); if (reply.Status == IPStatus.Success) { MessageBox.Show("OK"); } else { MessageBox.Show("NO"); }
在使用时,先引用 using System.Net.NetworkInformation;
Ping pingSender = new Ping(); PingReply reply = pingSender.Send("127.0.0.1"); if (reply.Status == IPStatus.Success) { MessageBox.Show("OK"); } else { MessageBox.Show("NO"); }
转载于:https://www.cnblogs.com/flay/p/3808490.html