System.Net.NetworkInformation.PingException Class

The exception that is thrown when a erload:System.Net.NetworkInformation.Ping.Send or erload:System.Net.NetworkInformation.Ping.SendAsync method calls a method that throws an exception.

See Also: PingException Members


public class PingException : InvalidOperationException


The System.Net.NetworkInformation.Ping class throws this exception to indicate that while sending an Internet Control Message Protocol (ICMP) Echo request, a method called by the System.Net.NetworkInformation.Ping class threw an unhandled exception. Applications should check the inner exception of a System.Net.NetworkInformation.PingException object to identify the problem.

The System.Net.NetworkInformation.Ping class does not throw this exception if the ICMP Echo request fails because of network, ICMP, or destination errors. For such errors, the System.Net.NetworkInformation.Ping class returns a System.Net.NetworkInformation.PingReply object with the relevant System.Net.NetworkInformation.IPStatus value set in the PingReply.Status property.


Namespace: System.Net.NetworkInformation
Assembly: System (in System.dll)
Assembly Versions:,
Since: .NET 2.0