My scenario:
When i ping with http://www.google.com it give the status Success, When i try to ping http://stackoverflow.com i got an exception “An exception occurred during a Ping request.” What is the reason? how can i solve?
using (Ping png = new Ping())
{
PingReply pr = png.Send("http://stackoverflow.com");
string status= pr.Status.ToString();
}
As Joachim said, drop the protocol. If you read the documentation ( http://msdn.microsoft.com/en-us/library/7hzczzed.aspx ) you’d be aware that the ping object wants a host name or address, not a URI.