C#我可以告诉使用哪个互联网连接

时间:2015-02-09 14:09:45

标签: html

在C#中可以使用互联网连接吗?

这是为了检查:

Ping myPing = new Ping();
String host = "google.com";
byte[] buffer = new byte[32];
int timeout = 1000;
PingOptions pingOptions = new PingOptions();
PingReply reply = myPing.Send(host, timeout, buffer, pingOptions);
if (reply.Status == IPStatus.Success) {
  // presumably online
}

0 个答案:

没有答案