IPGlobalProperties.GetIcmpV6Statistics Méthode

Définition

Fournit des données statistiques ICMP (Internet Control Message Protocol) version 6 pour l’ordinateur 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

Retours

Objet IcmpV6Statistics qui fournit des statistiques sur le trafic ICMP version 6 pour l’ordinateur local.

Attributs

Exceptions

La fonction Win32 GetIcmpStatisticsEx a échoué.

Le système d'exploitation de l'ordinateur local n'est pas Windows XP ou version ultérieure.

Exemples

L’exemple suivant affiche les statistiques ICMPv6 actuelles.

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("");
}

Remarques

ICMP version 6 est un ensemble de messages à utiliser avec le protocole Internet version 6 (IPv6). ICMP est utilisé par les nœuds IPv6 pour signaler les erreurs rencontrées dans le traitement des paquets de données et pour effectuer d’autres fonctions de couche Internet. ICMP version 6 est défini dans IETF RFC 1885.

Le protocole IPv6 n’est pas pris en charge pour les ordinateurs dotés de systèmes d’exploitation Windows 2000 ou antérieurs.

Pour plus d’informations sur les statistiques de trafic ICMP version 6 disponibles pour les applications, consultez la documentation de la IcmpV6Statistics classe. Notez que l’objet IcmpV6Statistics retourné par cette méthode reflète les statistiques au moment de la création de l’objet. Ces informations ne sont pas mises à jour dynamiquement.

S’applique à