IcmpV4Statistics.EchoRequestsReceived 属性

定义

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

public:
 abstract property long EchoRequestsReceived { long get(); };
public abstract long EchoRequestsReceived { get; }
member this.EchoRequestsReceived : int64
Public MustOverride ReadOnly Property EchoRequestsReceived As Long

属性值

一个 Int64 值,指定接收到的 ICMP“回送请求”消息的总数。

示例

以下示例显示此属性的值。

void ShowIcmpV4EchoData()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IcmpV4Statistics ^ statistics = properties->GetIcmpV4Statistics();
   Console::WriteLine( "  Echo Requests ....................... Sent: {0,-10}   Received: {1,-10}", 
      statistics->EchoRequestsSent, 
      statistics->EchoRequestsReceived );
   Console::WriteLine( "  Echo Replies ........................ Sent: {0,-10}   Received: {1,-10}", 
      statistics->EchoRepliesSent, 
      statistics->EchoRepliesReceived );
}
public static void ShowIcmpV4EchoData()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IcmpV4Statistics statistics = properties.GetIcmpV4Statistics();
    Console.WriteLine("  Echo Requests ....................... Sent: {0,-10}   Received: {1,-10}",
        statistics.EchoRequestsSent, statistics.EchoRequestsReceived);
    Console.WriteLine("  Echo Replies ........................ Sent: {0,-10}   Received: {1,-10}",
        statistics.EchoRepliesSent, statistics.EchoRepliesReceived);
}
Public Shared Sub ShowIcmpV4EchoData() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim statistics As IcmpV4Statistics = properties.GetIcmpV4Statistics()
    Console.WriteLine("  Echo Requests ....................... Sent: {0,-10}   Received: {1,-10}", statistics.EchoRequestsSent, statistics.EchoRequestsReceived)
    Console.WriteLine("  Echo Replies ........................ Sent: {0,-10}   Received: {1,-10}", statistics.EchoRepliesSent, statistics.EchoRepliesReceived)

End Sub

注解

回显请求和回显回复消息允许计算机从网络上的远程计算机请求 ICMP 响应。 此功能通常用于确定远程地址的有效性。

适用于