在使用时,先引用 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"); }

 

posted on 2014-06-25 17:27  BarneyX  阅读(235)  评论(0编辑  收藏  举报