IcmpV4Statistics 类

定义

提供本地计算机的 Internet 控制消息协议 IPv4 (ICMPv4) 统计数据。

public ref class IcmpV4Statistics abstract
public abstract class IcmpV4Statistics
type IcmpV4Statistics = class
Public MustInherit Class IcmpV4Statistics
继承
IcmpV4Statistics

示例

以下示例显示当前的 ICMPv4 统计信息。

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( "" );
}
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("");
}

注解

ICMPv4 是一组用于 Internet 协议版本 4 的错误和信息性消息。 ICMP 版本 4 在 IETF RFC 792 中定义。

方法使用 GetIcmpV4Statistics 此类返回 ICMPv4 流量信息。

构造函数

IcmpV4Statistics()

初始化 IcmpV4Statistics 类的新实例。

属性

AddressMaskRepliesReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“地址掩码应答”消息的数目。

AddressMaskRepliesSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“地址掩码应答”消息的数目。

AddressMaskRequestsReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“地址掩码请求”消息的数目。

AddressMaskRequestsSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“地址掩码请求”消息的数目。

DestinationUnreachableMessagesReceived

获取由于数据包的目标中存在无法访问的地址而接收到的 Internet 控制消息协议版本 4 (ICMPv4) 消息的数目。

DestinationUnreachableMessagesSent

获取由于数据包的目标中存在无法访问的地址而发送的 Internet 控制消息协议版本 4 (ICMPv4) 消息的数目。

EchoRepliesReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“回送应答”消息的数目。

EchoRepliesSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“回送应答”消息的数目。

EchoRequestsReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“回送请求”消息的数目。

EchoRequestsSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“回送请求”消息的数目。

ErrorsReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4) 错误消息的数目。

ErrorsSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4) 错误消息的数目。

MessagesReceived

获取接收到的 Internet 控制消息协议消息的数目。

MessagesSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4) 消息的数目。

ParameterProblemsReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“参数问题”消息的数目。

ParameterProblemsSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“参数问题”消息的数目。

RedirectsReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4) 重定向消息的数目。

RedirectsSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4) 重定向消息的数目。

SourceQuenchesReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“源抑制”消息的数目。

SourceQuenchesSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“源抑制”消息的数目。

TimeExceededMessagesReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“超时”消息的数目。

TimeExceededMessagesSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“超时”消息的数目。

TimestampRepliesReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“时间戳应答”消息的数目。

TimestampRepliesSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“时间戳应答”消息的数目。

TimestampRequestsReceived

获取接收到的 Internet 控制消息协议版本 4 (ICMPv4)“时间戳请求”消息的数目。

TimestampRequestsSent

获取已发送的 Internet 控制消息协议版本 4 (ICMPv4)“时间戳请求”消息的数目。

方法

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
ToString()

返回表示当前对象的字符串。

(继承自 Object)

适用于