IPGlobalStatistics.ReceivedPacketsWithUnknownProtocol 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得已在本機電腦 (Local Machine) 上收到,且標頭中含有未知通訊協定的網際網路通訊協定 (IP) 封包數目。
public:
abstract property long ReceivedPacketsWithUnknownProtocol { long get(); };
public abstract long ReceivedPacketsWithUnknownProtocol { get; }
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract long ReceivedPacketsWithUnknownProtocol { get; }
member this.ReceivedPacketsWithUnknownProtocol : int64
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.ReceivedPacketsWithUnknownProtocol : int64
Public MustOverride ReadOnly Property ReceivedPacketsWithUnknownProtocol As Long
屬性值
Int64 值,指定已收到且具有未知通訊協定的 IP 封包總數。
- 屬性
範例
下列程式代碼範例會顯示已接收IP封包的統計數據,並出現錯誤。
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 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 資料報數據報數據部分所使用的下一層通訊協定。 如果無法辨識通訊協定,就無法將數據傳遞至正確的應用程式。