語言

IPGlobalStatistics.ReceivedPacketsWithHeadersErrors 屬性

定義

取得接收到標頭錯誤的網際網路協定(IP)封包數量。

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

屬性值

此 Int64 值指定因標頭錯誤而接收與丟棄的 IP 封包總數。

屬性

範例

以下程式碼範例顯示了有錯誤的 IP 封包的統計資料。


public static void ShowInboundIPErrors()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
    Console.WriteLine("  Inbound Packet Errors:");
    Console.WriteLine("      Header Errors ....................... : {0}",
        ipstat.ReceivedPacketsWithHeadersErrors);
    Console.WriteLine("      Address Errors ...................... : {0}",
        ipstat.ReceivedPacketsWithAddressErrors);
    Console.WriteLine("      Unknown Protocol Errors ............. : {0}",
        ipstat.ReceivedPacketsWithUnknownProtocol);
}
Public Shared Sub ShowInboundIPErrors() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim ipstat As IPGlobalStatistics = properties.GetIPv4GlobalStatistics()
    Console.WriteLine("  Inbound Packet Errors:")
    Console.WriteLine("      Header Errors ....................... : {0}", ipstat.ReceivedPacketsWithHeadersErrors)
    Console.WriteLine("      Address Errors ...................... : {0}", ipstat.ReceivedPacketsWithAddressErrors)
    Console.WriteLine("      Unknown Protocol Errors ............. : {0}", ipstat.ReceivedPacketsWithUnknownProtocol)

End Sub

備註

此屬性回傳的值包含因標頭欄位中非位址相關問題而被丟棄的封包,例如校驗和錯誤、超過存活時間值及錯誤 IP 選項。

適用於