IPGlobalProperties.GetIcmpV4Statistics Método
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Fornece dados estatísticos do protocolo ICMP versão 4 para o computador local.
public:
abstract System::Net::NetworkInformation::IcmpV4Statistics ^ GetIcmpV4Statistics();
public abstract System.Net.NetworkInformation.IcmpV4Statistics GetIcmpV4Statistics ();
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract System.Net.NetworkInformation.IcmpV4Statistics GetIcmpV4Statistics ();
abstract member GetIcmpV4Statistics : unit -> System.Net.NetworkInformation.IcmpV4Statistics
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
abstract member GetIcmpV4Statistics : unit -> System.Net.NetworkInformation.IcmpV4Statistics
Public MustOverride Function GetIcmpV4Statistics () As IcmpV4Statistics
Um objeto IcmpV4Statistics que fornece estatísticas de tráfego de ICMP versão 4 para o computador local.
- Atributos
A função Win32 GetIcmpStatistics
falhou.
O exemplo a seguir exibe as estatísticas atuais do ICMPv4.
void ShowIcmpV4Statistics()
{
IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
IcmpV4Statistics ^ stat = properties->GetIcmpV4Statistics();
Console::WriteLine( "ICMP V4 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( " Source Quenches ..................... Sent: {0,-10} Received: {1,-10}", stat->SourceQuenchesSent, stat->SourceQuenchesReceived );
Console::WriteLine( " Redirects ........................... Sent: {0,-10} Received: {1,-10}", stat->RedirectsSent, stat->RedirectsReceived );
Console::WriteLine( " TimeExceeded ........................ Sent: {0,-10} Received: {1,-10}", stat->TimeExceededMessagesSent, stat->TimeExceededMessagesReceived );
Console::WriteLine( " Parameter Problems .................. Sent: {0,-10} Received: {1,-10}", stat->ParameterProblemsSent, stat->ParameterProblemsReceived );
Console::WriteLine( " Timestamp Requests .................. Sent: {0,-10} Received: {1,-10}", stat->TimestampRequestsSent, stat->TimestampRequestsReceived );
Console::WriteLine( " Timestamp Replies ................... Sent: {0,-10} Received: {1,-10}", stat->TimestampRepliesSent, stat->TimestampRepliesReceived );
Console::WriteLine( " Address Mask Requests ............... Sent: {0,-10} Received: {1,-10}", stat->AddressMaskRequestsSent, stat->AddressMaskRequestsReceived );
Console::WriteLine( " Address Mask Replies ................ Sent: {0,-10} Received: {1,-10}", stat->AddressMaskRepliesSent, stat->AddressMaskRepliesReceived );
Console::WriteLine( "" );
}
public static void ShowIcmpV4Statistics()
{
IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
IcmpV4Statistics stat = properties.GetIcmpV4Statistics();
Console.WriteLine("ICMP V4 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(" Source Quenches ..................... Sent: {0,-10} Received: {1,-10}",
stat.SourceQuenchesSent, stat.SourceQuenchesReceived);
Console.WriteLine(" Redirects ........................... Sent: {0,-10} Received: {1,-10}",
stat.RedirectsSent, stat.RedirectsReceived);
Console.WriteLine(" TimeExceeded ........................ Sent: {0,-10} Received: {1,-10}",
stat.TimeExceededMessagesSent, stat.TimeExceededMessagesReceived);
Console.WriteLine(" Parameter Problems .................. Sent: {0,-10} Received: {1,-10}",
stat.ParameterProblemsSent, stat.ParameterProblemsReceived);
Console.WriteLine(" Timestamp Requests .................. Sent: {0,-10} Received: {1,-10}",
stat.TimestampRequestsSent, stat.TimestampRequestsReceived);
Console.WriteLine(" Timestamp Replies ................... Sent: {0,-10} Received: {1,-10}",
stat.TimestampRepliesSent, stat.TimestampRepliesReceived);
Console.WriteLine(" Address Mask Requests ............... Sent: {0,-10} Received: {1,-10}",
stat.AddressMaskRequestsSent, stat.AddressMaskRequestsReceived);
Console.WriteLine(" Address Mask Replies ................ Sent: {0,-10} Received: {1,-10}",
stat.AddressMaskRepliesSent, stat.AddressMaskRepliesReceived);
Console.WriteLine("");
}
O ICMP é um conjunto de mensagens para uso com o Protocolo de Internet versão 4 (IPv4). O ICMP é usado por nós IPv4 para relatar erros encontrados no processamento de pacotes de dados e para executar outras funções de camada da Internet. O ICMP versão 4 é definido no IETF RFC 792.
Para obter detalhes sobre as estatísticas de tráfego do ICMP versão 4 que estão disponíveis para aplicativos, consulte a documentação da IcmpV4Statistics classe. Observe que o IcmpV4Statistics 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.
Produto | Versões |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: