Compartilhar via


IPGlobalProperties.GetIcmpV6Statistics Método

Definição

Fornece dados estatísticos do protocolo ICMP versão 6 para o computador local.

public:
 abstract System::Net::NetworkInformation::IcmpV6Statistics ^ GetIcmpV6Statistics();
public abstract System.Net.NetworkInformation.IcmpV6Statistics GetIcmpV6Statistics ();
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract System.Net.NetworkInformation.IcmpV6Statistics GetIcmpV6Statistics ();
abstract member GetIcmpV6Statistics : unit -> System.Net.NetworkInformation.IcmpV6Statistics
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
abstract member GetIcmpV6Statistics : unit -> System.Net.NetworkInformation.IcmpV6Statistics
Public MustOverride Function GetIcmpV6Statistics () As IcmpV6Statistics

Retornos

Um objeto IcmpV6Statistics que fornece estatísticas de tráfego de ICMP versão 6 para o computador local.

Atributos

Exceções

A função Win32 GetIcmpStatisticsEx falhou.

O sistema operacional do computador local não é o Windows XP ou posterior.

Exemplos

O exemplo a seguir exibe as estatísticas atuais do ICMPv6.

void ShowIcmpV6Statistics()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IcmpV6Statistics ^ stat = properties->GetIcmpV6Statistics();
   Console::WriteLine( "ICMP V6 Statistics:" );
   Console::WriteLine( "  Messages ............................ Sent: {0,-10}   Received: {1,-10}", stat->MessagesSent, stat->MessagesReceived );
   Console::WriteLine( "  Errors .............................. Sent: {0,-10}   Received: {1,-10}", stat->ErrorsSent, stat->ErrorsReceived );
   Console::WriteLine( "  Echo Requests ....................... Sent: {0,-10}   Received: {1,-10}", stat->EchoRequestsSent, stat->EchoRequestsReceived );
   Console::WriteLine( "  Echo Replies ........................ Sent: {0,-10}   Received: {1,-10}", stat->EchoRepliesSent, stat->EchoRepliesReceived );
   Console::WriteLine( "  Destination Unreachables ............ Sent: {0,-10}   Received: {1,-10}", stat->DestinationUnreachableMessagesSent, stat->DestinationUnreachableMessagesReceived );
   Console::WriteLine( "  Parameter Problems .................. Sent: {0,-10}   Received: {1,-10}", stat->ParameterProblemsSent, stat->ParameterProblemsReceived );
   Console::WriteLine( "  Packets Too Big ..................... Sent: {0,-10}   Received: {1,-10}", stat->PacketTooBigMessagesSent, stat->PacketTooBigMessagesReceived );
   Console::WriteLine( "  Redirects ........................... Sent: {0,-10}   Received: {1,-10}", stat->RedirectsSent, stat->RedirectsReceived );
   Console::WriteLine( "  Router Advertisements ............... Sent: {0,-10}   Received: {1,-10}", stat->RouterAdvertisementsSent, stat->RouterAdvertisementsReceived );
   Console::WriteLine( "  Router Solicitations ................ Sent: {0,-10}   Received: {1,-10}", stat->RouterSolicitsSent, stat->RouterSolicitsReceived );
   Console::WriteLine( "  Time Exceeded ....................... Sent: {0,-10}   Received: {1,-10}", stat->TimeExceededMessagesSent, stat->TimeExceededMessagesReceived );
   Console::WriteLine( "  Neighbor Advertisements ............. Sent: {0,-10}   Received: {1,-10}", stat->NeighborAdvertisementsSent, stat->NeighborAdvertisementsReceived );
   Console::WriteLine( "  Neighbor Solicitations .............. Sent: {0,-10}   Received: {1,-10}", stat->NeighborSolicitsSent, stat->NeighborSolicitsReceived );
   Console::WriteLine( "  Membership Queries .................. Sent: {0,-10}   Received: {1,-10}", stat->MembershipQueriesSent, stat->MembershipQueriesReceived );
   Console::WriteLine( "  Membership Reports .................. Sent: {0,-10}   Received: {1,-10}", stat->MembershipReportsSent, stat->MembershipReportsReceived );
   Console::WriteLine( "  Membership Reductions ............... Sent: {0,-10}   Received: {1,-10}", stat->MembershipReductionsSent, stat->MembershipReductionsReceived );
   Console::WriteLine( "" );
}
public static void ShowIcmpV6Statistics()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IcmpV6Statistics stat = properties.GetIcmpV6Statistics();
    Console.WriteLine("ICMP V6 Statistics:");
    Console.WriteLine("  Messages ............................ Sent: {0,-10}   Received: {1,-10}",
        stat.MessagesSent, stat.MessagesReceived);
    Console.WriteLine("  Errors .............................. Sent: {0,-10}   Received: {1,-10}",
        stat.ErrorsSent, stat.ErrorsReceived);

    Console.WriteLine("  Echo Requests ....................... Sent: {0,-10}   Received: {1,-10}",
        stat.EchoRequestsSent, stat.EchoRequestsReceived);
    Console.WriteLine("  Echo Replies ........................ Sent: {0,-10}   Received: {1,-10}",
        stat.EchoRepliesSent, stat.EchoRepliesReceived);

    Console.WriteLine("  Destination Unreachables ............ Sent: {0,-10}   Received: {1,-10}",
        stat.DestinationUnreachableMessagesSent, stat.DestinationUnreachableMessagesReceived);

    Console.WriteLine("  Parameter Problems .................. Sent: {0,-10}   Received: {1,-10}",
        stat.ParameterProblemsSent, stat.ParameterProblemsReceived);

    Console.WriteLine("  Packets Too Big ..................... Sent: {0,-10}   Received: {1,-10}",
        stat.PacketTooBigMessagesSent, stat.PacketTooBigMessagesReceived);

    Console.WriteLine("  Redirects ........................... Sent: {0,-10}   Received: {1,-10}",
        stat.RedirectsSent, stat.RedirectsReceived);

    Console.WriteLine("  Router Advertisements ............... Sent: {0,-10}   Received: {1,-10}",
        stat.RouterAdvertisementsSent, stat.RouterAdvertisementsReceived);
    Console.WriteLine("  Router Solicitations ................ Sent: {0,-10}   Received: {1,-10}",
        stat.RouterSolicitsSent, stat.RouterSolicitsReceived);

    Console.WriteLine("  Time Exceeded ....................... Sent: {0,-10}   Received: {1,-10}",
        stat.TimeExceededMessagesSent, stat.TimeExceededMessagesReceived);

    Console.WriteLine("  Neighbor Advertisements ............. Sent: {0,-10}   Received: {1,-10}",
        stat.NeighborAdvertisementsSent, stat.NeighborAdvertisementsReceived);
    Console.WriteLine("  Neighbor Solicitations .............. Sent: {0,-10}   Received: {1,-10}",
        stat.NeighborSolicitsSent, stat.NeighborSolicitsReceived);

    Console.WriteLine("  Membership Queries .................. Sent: {0,-10}   Received: {1,-10}",
        stat.MembershipQueriesSent, stat.MembershipQueriesReceived);
    Console.WriteLine("  Membership Reports .................. Sent: {0,-10}   Received: {1,-10}",
        stat.MembershipReportsSent, stat.MembershipReportsReceived);
    Console.WriteLine("  Membership Reductions ............... Sent: {0,-10}   Received: {1,-10}",
        stat.MembershipReductionsSent, stat.MembershipReductionsReceived);

    Console.WriteLine("");
}

Comentários

O ICMP versão 6 é um conjunto de mensagens para uso com o Protocolo de Internet versão 6 (IPv6). O ICMP é usado por nós IPv6 para relatar erros encontrados no processamento de pacotes de dados e para executar outras funções de camada da Internet. O ICMP versão 6 é definido no IETF RFC 1885.

O protocolo IPv6 não tem suporte para computadores com o Windows 2000 ou sistemas operacionais anteriores.

Para obter detalhes sobre as estatísticas de tráfego do ICMP versão 6 disponíveis para aplicativos, consulte a documentação da IcmpV6Statistics classe. Observe que o IcmpV6Statistics objeto retornado por esse método reflete as estatísticas a partir do momento em que o objeto é criado. Essas informações não são atualizadas dinamicamente.

Aplica-se a