.NET ez 2011-11-29
利用.Net 的 System.Net.NetworkInformation.Ping 測試網路是否正常!
System.Net.NetworkInformation.Ping NetPing = new System.Net.NetworkInformation.Ping(); System.Net.NetworkInformation.PingReply NetPingReply = NetPing.Send("168.95.1.1", 5000); if(NetPingReply.Status == System.Net.NetworkInformation.IPStatus.Success) { MessageBox.Show("OK"); } else { MessageBox.Show("ERROR"); }
標籤: .NET