Sdílet prostřednictvím


IPGlobalStatistics.ReceivedPacketsForwarded Vlastnost

Definice

Získá počet přeposlaných paketů protokolu IP(Internet Protocol).

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

Hodnota vlastnosti

Hodnota Int64 , která určuje celkový počet předávaných paketů.

Atributy

Příklady

Následující příklad kódu zobrazuje statistiky pro přijaté pakety 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

Poznámky

Pokud místní počítač není směrovač, hodnota vrácená touto vlastností zahrnuje pakety, které byly úspěšně směrovány zdrojem přes místní počítač. Směrování zdroje je možnost IP, kdy zdroj paketu může určit trasu na cílovou adresu.

Platí pro