maf*_*afu 10
工作?好吧,你必须使用它们来查看它们是否正常工作.
如果你想看看他们是否在线,我想这ping是第一步.
.NET中有一个Ping类.
using System.Net.NetworkInformation;
private static bool CanPing(string address)
{
Ping ping = new Ping();
try
{
PingReply reply = ping.Send(address, 2000);
if (reply == null) return false;
return (reply.Status == IPStatus.Success);
}
catch (PingException e)
{
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23120 次 |
| 最近记录: |