This checks the availability of a server by sending a ping to the given IP address and waiting a certain amount of time for a response from the server:
public static bool ServerAvailable(string ip, int timeout) { Ping pingSender = new Ping(); PingReply reply; try { reply = pingSender.Send(ip, timeout); } catch { return false; } return (reply.Status == IPStatus.Success); }