Ping.PingCompleted Ping.PingCompleted Ping.PingCompleted Ping.PingCompleted Event

Definición

Se produce cuando una operación asincrónica para enviar un mensaje de eco ICMP (Protocolo de mensajes de control de Internet) y recibir el mensaje de respuesta de eco ICMP correspondiente finaliza o se cancela.Occurs when an asynchronous operation to send an Internet Control Message Protocol (ICMP) echo message and receive the corresponding ICMP echo reply message completes or is canceled.

public:
 event System::Net::NetworkInformation::PingCompletedEventHandler ^ PingCompleted;
public event System.Net.NetworkInformation.PingCompletedEventHandler PingCompleted;
member this.PingCompleted : System.Net.NetworkInformation.PingCompletedEventHandler 
Public Event PingCompleted As PingCompletedEventHandler 

Ejemplos

En el ejemplo de código siguiente se muestra cómo especificar un método PingCompleted de devolución de llamada para el evento.The following code example demonstrates specifying a callback method for the PingCompleted event. El ejemplo completo está disponible en la Ping información general de la clase.The complete example is available in the Ping class overview.

Ping ^ pingSender = gcnew Ping;

// When the PingCompleted event is raised,
// the PingCompletedCallback method is called.
pingSender->PingCompleted += gcnew PingCompletedEventHandler( PingCompletedCallback );

Ping pingSender = new Ping ();

// When the PingCompleted event is raised,
// the PingCompletedCallback method is called.
pingSender.PingCompleted += new PingCompletedEventHandler (PingCompletedCallback);

Comentarios

Las aplicaciones usan PingCompleted el evento para obtener información sobre el estado de finalización y los datos recopilados por una SendAsync llamada a uno de los métodos.Applications use the PingCompleted event to get information about the completion status and data collected by a call to one of the SendAsync methods. El PingCompletedEventHandler delegado proporciona el método de devolución de llamada invocado cuando SendAsync genera este evento.The PingCompletedEventHandler delegate provides the call back method invoked when SendAsync raises this event.

Se aplica a