IPGlobalStatistics.ReceivedPacketsForwarded 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
接收轉發的網際網路協定(IP)封包數量。
public:
abstract property long ReceivedPacketsForwarded { long get(); };
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract long ReceivedPacketsForwarded { get; }
public abstract long ReceivedPacketsForwarded { get; }
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.ReceivedPacketsForwarded : int64
member this.ReceivedPacketsForwarded : int64
Public MustOverride ReadOnly Property ReceivedPacketsForwarded As Long
屬性值
一個 Int64 指定轉發封包總數的值。
- 屬性
範例
以下程式碼範例顯示接收到的 IP 封包的統計資料。
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 選項,封包的來源可以指定到目的地地址的路由。