語言

IPGlobalStatistics.ReceivedPacketsWithAddressErrors 屬性

定義

取得收到的帶有位址錯誤的網際網路協定(IP)封包數量。

public:
 abstract property long ReceivedPacketsWithAddressErrors { long get(); };
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract long ReceivedPacketsWithAddressErrors { get; }
public abstract long ReceivedPacketsWithAddressErrors { get; }
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.ReceivedPacketsWithAddressErrors : int64
member this.ReceivedPacketsWithAddressErrors : int64
Public MustOverride ReadOnly Property ReceivedPacketsWithAddressErrors 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

備註

此屬性回傳的值包含因標頭欄位中位址相關問題而被丟棄的封包,例如無效位址。 若未啟用封包轉發,該屬性回傳的值包含因目的地址非本地地址而被丟棄的封包。

適用於