IPGlobalStatistics.ReceivedPacketsForwarded 属性

定义

获取转发的 Internet 协议 (IP) 数据包数。

public:
 abstract property long ReceivedPacketsForwarded { long get(); };
public abstract long ReceivedPacketsForwarded { get; }
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract long ReceivedPacketsForwarded { get; }
member this.ReceivedPacketsForwarded : int64
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.ReceivedPacketsForwarded : int64
Public MustOverride ReadOnly Property ReceivedPacketsForwarded As Long

属性值

Int64 值,它指定转发的数据包的总数。

属性

示例

下面的代码示例显示接收的 IP 数据包的统计信息。

void ShowInboundIPStatistics()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IPGlobalStatistics ^ ipstat = properties->GetIPv4GlobalStatistics();
   Console::WriteLine( "  Inbound Packet Data:" );
   Console::WriteLine( "      Received ............................ : {0}", 
      ipstat->ReceivedPackets );
   Console::WriteLine( "      Forwarded ........................... : {0}", 
      ipstat->ReceivedPacketsForwarded );
   Console::WriteLine( "      Delivered ........................... : {0}", 
      ipstat->ReceivedPacketsDelivered );
   Console::WriteLine( "      Discarded ........................... : {0}", 
      ipstat->ReceivedPacketsDiscarded );
}
public static void ShowInboundIPStatistics()
{
     IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
     IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
     Console.WriteLine("  Inbound Packet Data:");
     Console.WriteLine("      Received ............................ : {0}",
     ipstat.ReceivedPackets);
     Console.WriteLine("      Forwarded ........................... : {0}",
     ipstat.ReceivedPacketsForwarded);
     Console.WriteLine("      Delivered ........................... : {0}",
     ipstat.ReceivedPacketsDelivered);
     Console.WriteLine("      Discarded ........................... : {0}",
     ipstat.ReceivedPacketsDiscarded);
}
Public Shared Sub ShowInboundIPStatistics() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim ipstat As IPGlobalStatistics = properties.GetIPv4GlobalStatistics()
    Console.WriteLine("  Inbound Packet Data:")
    Console.WriteLine("      Received ............................ : {0}", ipstat.ReceivedPackets)
    Console.WriteLine("      Forwarded ........................... : {0}", ipstat.ReceivedPacketsForwarded)
    Console.WriteLine("      Delivered ........................... : {0}", ipstat.ReceivedPacketsDelivered)
    Console.WriteLine("      Discarded ........................... : {0}", ipstat.ReceivedPacketsDiscarded)

End Sub

注解

如果本地计算机不是路由器,则此属性返回的值包括通过本地计算机成功进行源路由的数据包。 源路由是一个 IP 选项,数据包的源可以通过该选项指定到目标地址的路由。

适用于