private static bool Ping(string address) { var ping = new System.Net.NetworkInformation.Ping(); PingReply reply = null; try { reply = ping.Send(address); } catch (Exception e) { return(false); } if (reply != null) { return(reply.Status == IPStatus.Success); } return(false); }
private static bool Ping(string address) { var ping = new System.Net.NetworkInformation.Ping(); PingReply reply = null; try { reply = ping.Send(address); } catch (Exception e) { return false; } if (reply != null) return reply.Status == IPStatus.Success; return false; }