bool isconn = true;
PingReply pr;
Ping ping = new Ping();
pr = ping.Send("lightyiyi.cn");
if (pr.Status != IPStatus.Success)
{
isconn = false;
}
MessageBox.Show(isconn.ToString());