Check the availability of a Host using C#

Madhu.b.rokkam
Posted by Madhu.b.rokkam under C# category on | Points: 40 | Views : 3364
static void Main(string[] args)
{
System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply reply = ping.Send("Gmail.com");
Console.WriteLine("Address: {0}", reply.Address);
Console.WriteLine("Status: {0}", reply.Status);
Console.Read();
}


Result

address: 209.85.231.83
status: Success

Comments or Responses

Login to post response