IPGlobalStatistics.ReceivedPacketsWithUnknownProtocol Właściwość

Definicja

Pobiera liczbę pakietów protokołu internetowego (IP) odebranych na komputerze lokalnym z nieznanym protokołem w nagłówku.

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

Wartość właściwości

Wartość wskazująca Int64 całkowitą liczbę pakietów IP odebranych przy użyciu nieznanego protokołu.

Atrybuty

Przykłady

Poniższy przykład kodu przedstawia statystyki odebranych pakietów IP z błędami.

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

Uwagi

Pole protokołu w nagłówku IP wskazuje protokół następnego poziomu używany w części danych datagramu IP. Jeśli protokół nie jest rozpoznawany, nie można przekazać danych do właściwej aplikacji.

Dotyczy