IcmpV4Statistics.DestinationUnreachableMessagesSent 属性

定义

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

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

属性值

Int64 值,指定发送的“无法到达目标”消息的总数。

示例

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

void ShowIcmpV4UnreachableData()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IcmpV4Statistics ^ statistics = properties->GetIcmpV4Statistics();
   Console::WriteLine( "  Destination Unreachables ............ Sent: {0,-10}   Received: {1,-10}", 
      statistics->DestinationUnreachableMessagesSent, 
      statistics->DestinationUnreachableMessagesReceived );
}
public static void ShowIcmpV4UnreachableData()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IcmpV4Statistics statistics = properties.GetIcmpV4Statistics();
    Console.WriteLine("  Destination Unreachables ............ Sent: {0,-10}   Received: {1,-10}",
        statistics.DestinationUnreachableMessagesSent,
        statistics.DestinationUnreachableMessagesReceived);
}
Public Shared Sub ShowIcmpV4UnreachableData() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim statistics As IcmpV4Statistics = properties.GetIcmpV4Statistics()
    Console.WriteLine("  Destination Unreachables ............ Sent: {0,-10}   Received: {1,-10}", statistics.DestinationUnreachableMessagesSent, statistics.DestinationUnreachableMessagesReceived)

End Sub

注解

出于以下任一原因,可以将“目标无法访问”消息发送到作为数据包源的计算机:

  • 计算机找不到指向目标地址的路由。

  • 管理上禁止与目标地址通信。 例如,防火墙会阻止将数据包传送到目标。

  • 无法访问目标地址。

  • 无法访问目标端口。 例如,没有可用于数据包协议的侦听器。

适用于