IPGlobalStatistics.ReceivedPacketsWithAddressErrors 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得已收到且具有位址錯誤的網際網路通訊協定 (IP) 封包數目。
public:
abstract property long ReceivedPacketsWithAddressErrors { long get(); };
public abstract long ReceivedPacketsWithAddressErrors { get; }
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract long ReceivedPacketsWithAddressErrors { get; }
member this.ReceivedPacketsWithAddressErrors : int64
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.ReceivedPacketsWithAddressErrors : int64
Public MustOverride ReadOnly Property ReceivedPacketsWithAddressErrors 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
備註
這個屬性傳回的值包含針對標頭欄位中的地址相關問題捨棄的封包,例如無效的位址。 如果未啟用封包轉送,這個屬性傳回的值會包含因為目的地位址不是本機位址而捨棄的封包。