IPGlobalStatistics.OutputPacketsDiscarded 屬性

定義

取得已捨棄的傳送網際網路通訊協定 (IP) 封包數目。

C#
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract long OutputPacketsDiscarded { get; }
C#
public abstract long OutputPacketsDiscarded { get; }

屬性值

Int64 值,指定已捨棄的輸出封包總數。

屬性

範例

下列程式代碼範例會顯示輸出IP封包的統計數據。

C#

public static void ShowOutboundIPStatistics()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
    Console.WriteLine("  Outbound Packet Data:");
    Console.WriteLine("      Requested ........................... : {0}",
        ipstat.OutputPacketRequests);
    Console.WriteLine("      Discarded ........................... : {0}",
        ipstat.OutputPacketsDiscarded);
    Console.WriteLine("      No Routing Discards ................. : {0}",
        ipstat.OutputPacketsWithNoRoute);
    Console.WriteLine("      Routing Entry Discards .............. : {0}",
        ipstat.OutputPacketRoutingDiscards);
}

備註

此屬性傳回的數據不包含因為封包無法傳遞的錯誤而捨棄的封包。 此數據中包含的封包通常會因為網路問題而捨棄,例如緩衝區空間不足。

適用於

產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1