با استفاده از کلاس Ping میتوان اینکار را انجام داد:
int timeout = 500;
Ping pingClass = new Ping();
PingReply pingReply = pingClass.Send("google.com",timeout);
if (pingReply.Status == IPStatus.Success)
{
resultLabel.Text = ("Connection is OK: "+pingReply.RoundtripTime.ToString() + "ms");
}