This post shows you How to use Ping in C# to ping an IP Address.

Ping a IP address using C#

Ping ping = new Ping();
PingReply pingReply = ping.Send("192.168.1.150", 2000);

If you want to print the results on the screen, you can write.

if (pingReply != null)
    Console.WriteLine($"Status : {pingReply.Status} \n Time : {pingReply.RoundtripTime} \n Address : {pingReply.Address}");

Ping is a very useful utility used to determine the speed of Network Connection. It establishes a socket connection with the given hostname and sends a Data Packet using ICMP Protocol.