C# Example:

using System;
using Sockets4ICMP;
namespace Sockets4ICMP
{
class Class1
{
static void Main(string[] args)
{
    //Send a single ping
    Console.WriteLine("Response time to Yahoo="
        + Pinger.PingNow("www.yahoo.com"));
    
    //Issue 5 pings in the background
    Pinger p = new Pinger();
    p.PingCount = 5;
    //Add receiver delgate to events
    p.Pong += new PingReceived(p_pong);
    //Beginning pinging the host
    p.StartPinging("www.yahoo.com");
    Console.ReadLine();
}

static void p_pong(object sender, ICMPReceivedEventArgs e)
{
    Console.WriteLine("pong " + e.ElapsedTime);
}
}
}
End Class