Pinging a Host or Machine in C#.

vishalneeraj-24503
Posted by vishalneeraj-24503 under C# category on | Points: 40 | Views : 510
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;

private static void Main(string[] args)
{
System.Net.NetworkInformation.Ping pingServices = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply Output = pingServices.Send("www.dotnetfunda.com");
Console.WriteLine("IPAddress : " + Output.Address);
Console.WriteLine("TTL" + Output.Options.Ttl);
Console.WriteLine("Status" + Output.Status);
Console.ReadLine();
}

Comments or Responses

Login to post response