【分享】C#如何快速判断系统是否已经联网?

using System.Net.NetworkInformation;
public bool IsConnected()
{
 Ping ping = new Ping ();
 PingReply reply = ping.Send("www.baidu.com");
 return (reply.Status == IPStatus.Success);
}

posted @ 2013-07-12 14:03  zehrry  阅读(297)  评论(1编辑  收藏  举报