IPGlobalStatistics.ReceivedPacketsWithUnknownProtocol 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得本地機器接收到的網際網路協定(IP)封包數量,標頭中包含未知協定。
public:
abstract property long ReceivedPacketsWithUnknownProtocol { long get(); };
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract long ReceivedPacketsWithUnknownProtocol { get; }
public abstract long ReceivedPacketsWithUnknownProtocol { get; }
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.ReceivedPacketsWithUnknownProtocol : int64
member this.ReceivedPacketsWithUnknownProtocol : int64
Public MustOverride ReadOnly Property ReceivedPacketsWithUnknownProtocol 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 標頭中的協定欄位表示 IP 資料報資料部分所使用的次階協定。 若協定未被識別,資料無法傳遞給正確的應用程式。