語言

IPGlobalStatistics.ReceivedPackets 屬性

定義

取得收到的網際網路協定(IP)封包數量。

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

屬性值

一個 Int64 指定總接收 IP 封包數量的值。

屬性

範例

以下程式碼範例顯示接收到的 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

備註

此屬性回傳的值包含錯誤收到的封包。

適用於