.net ping
So easy to ping in .net…
using System.Net.NetworkInformation;
private string pingHost(String hostip)
{
Ping pingSender = new Ping();
PingReply reply = pingSender.Send(hostip);
String str;
if (reply.Status == IPStatus.Success)
{
str = “”. Host is up”";
str += “”, Address: “” + reply.Address.ToString();
str += “”, RoundTrip time: “” + reply.RoundtripTime + “” ms.”";
}
else
str = “”. Host is down.”";
return str;
}
Related posts:












