I have 5 pc and i want to ping this pc\'s are available or no. So I\'m using c# Ping class. Two pc are available but the other 3 pc are closed when i ping them my program wa
Pinging to IP Address like 8.8.8.8 worked absolutely fine, but when pinging to dns address like www.google.com give random time outs.
i think these random time outs relates to dns resolution nothing to do with ping time outs
private static bool DoPing()
{
try
{
using (System.Net.NetworkInformation.Ping ping = new Ping())
{
PingReply result = ping.Send("8.8.8.8", 500, new byte[32], new PingOptions { DontFragment = true, Ttl = 32 });
if (result.Status == IPStatus.Success)
return true;
return false;
}
}
catch
{
return false;
}
}