Export (0) Print
Expand All

IcmpV4Statistics Class

Provides Internet Control Message Protocol for IPv4 (ICMPv4) statistical data for the local computer.

System.Object
  System.Net.NetworkInformation.IcmpV4Statistics

Namespace:  System.Net.NetworkInformation
Assemblies:   System (in System.dll)
  System.Net.NetworkInformation (in System.Net.NetworkInformation.dll)

public abstract class IcmpV4Statistics

The IcmpV4Statistics type exposes the following members.

  NameDescription
Protected methodIcmpV4StatisticsInitializes a new instance of the IcmpV4Statistics class.
Top

  NameDescription
Public propertyAddressMaskRepliesReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Address Mask Reply messages that were received.
Public propertyAddressMaskRepliesSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Address Mask Reply messages that were sent.
Public propertyAddressMaskRequestsReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Address Mask Request messages that were received.
Public propertyAddressMaskRequestsSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Address Mask Request messages that were sent.
Public propertyDestinationUnreachableMessagesReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) messages that were received because of a packet having an unreachable address in its destination.
Public propertyDestinationUnreachableMessagesSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) messages that were sent because of a packet having an unreachable address in its destination.
Public propertyEchoRepliesReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Reply messages that were received.
Public propertyEchoRepliesSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Reply messages that were sent.
Public propertyEchoRequestsReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Request messages that were received.
Public propertyEchoRequestsSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Request messages that were sent.
Public propertyErrorsReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) error messages that were received.
Public propertyErrorsSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) error messages that were sent.
Public propertyMessagesReceivedGets the number of Internet Control Message Protocol messages that were received.
Public propertyMessagesSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) messages that were sent.
Public propertyParameterProblemsReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Parameter Problem messages that were received.
Public propertyParameterProblemsSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Parameter Problem messages that were sent.
Public propertyRedirectsReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Redirect messages that were received.
Public propertyRedirectsSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Redirect messages that were sent.
Public propertySourceQuenchesReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Source Quench messages that were received.
Public propertySourceQuenchesSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Source Quench messages that were sent.
Public propertyTimeExceededMessagesReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Time Exceeded messages that were received.
Public propertyTimeExceededMessagesSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Time Exceeded messages that were sent.
Public propertyTimestampRepliesReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Timestamp Reply messages that were received.
Public propertyTimestampRepliesSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Timestamp Reply messages that were sent.
Public propertyTimestampRequestsReceivedGets the number of Internet Control Message Protocol version 4 (ICMPv4) Timestamp Request messages that were received.
Public propertyTimestampRequestsSentGets the number of Internet Control Message Protocol version 4 (ICMPv4) Timestamp Request messages that were sent.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

ICMPv4 is a set of error and informational messages for use with Internet Protocol version 4. ICMP version 4 is defined in IETF RFC 792.

This class is used by the GetIcmpV4Statistics method to return ICMPv4 traffic information.

The following example displays the current ICMPv4 statistics.

public static void ShowIcmpV4Statistics()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IcmpV4Statistics stat = properties.GetIcmpV4Statistics();
    Console.WriteLine("ICMP V4 Statistics:");

    Console.WriteLine("  Messages ............................ Sent: {0,-10}   Received: {1,-10}",
        stat.MessagesSent, stat.MessagesReceived);
    Console.WriteLine("  Errors .............................. Sent: {0,-10}   Received: {1,-10}",
        stat.ErrorsSent, stat.ErrorsReceived);

    Console.WriteLine("  Echo Requests ....................... Sent: {0,-10}   Received: {1,-10}",
        stat.EchoRequestsSent, stat.EchoRequestsReceived);
    Console.WriteLine("  Echo Replies ........................ Sent: {0,-10}   Received: {1,-10}",
        stat.EchoRepliesSent, stat.EchoRepliesReceived);

    Console.WriteLine("  Destination Unreachables ............ Sent: {0,-10}   Received: {1,-10}",
        stat.DestinationUnreachableMessagesSent, stat.DestinationUnreachableMessagesReceived);

    Console.WriteLine("  Source Quenches ..................... Sent: {0,-10}   Received: {1,-10}",
        stat.SourceQuenchesSent, stat.SourceQuenchesReceived);

    Console.WriteLine("  Redirects ........................... Sent: {0,-10}   Received: {1,-10}",
        stat.RedirectsSent, stat.RedirectsReceived);  

    Console.WriteLine("  TimeExceeded ........................ Sent: {0,-10}   Received: {1,-10}",
        stat.TimeExceededMessagesSent, stat.TimeExceededMessagesReceived);

    Console.WriteLine("  Parameter Problems .................. Sent: {0,-10}   Received: {1,-10}",
        stat.ParameterProblemsSent, stat.ParameterProblemsReceived);        

    Console.WriteLine("  Timestamp Requests .................. Sent: {0,-10}   Received: {1,-10}",
        stat.TimestampRequestsSent, stat.TimestampRequestsReceived);    
    Console.WriteLine("  Timestamp Replies ................... Sent: {0,-10}   Received: {1,-10}",
        stat.TimestampRepliesSent, stat.TimestampRepliesReceived);    

    Console.WriteLine("  Address Mask Requests ............... Sent: {0,-10}   Received: {1,-10}",
        stat.AddressMaskRequestsSent, stat.AddressMaskRequestsReceived);    
    Console.WriteLine("  Address Mask Replies ................ Sent: {0,-10}   Received: {1,-10}",
        stat.AddressMaskRepliesSent, stat.AddressMaskRepliesReceived);                    
    Console.WriteLine("");
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft