WebClient.UploadDataCompleted WebClient.UploadDataCompleted WebClient.UploadDataCompleted WebClient.UploadDataCompleted Event

Definición

Se produce cuando finaliza una operación de carga de datos asincrónica.Occurs when an asynchronous data-upload operation completes.

public:
 event System::Net::UploadDataCompletedEventHandler ^ UploadDataCompleted;
public event System.Net.UploadDataCompletedEventHandler UploadDataCompleted;
member this.UploadDataCompleted : System.Net.UploadDataCompletedEventHandler 
Public Custom Event UploadDataCompleted As UploadDataCompletedEventHandler 

Ejemplos

En el ejemplo de código siguiente se muestra cómo establecer un controlador de eventos para este evento.The following code example demonstrates setting an event handler for this event.

void UploadDataInBackground3( String^ address )
{
   WebClient^ client = gcnew WebClient;
   Uri ^uri = gcnew Uri(address);
   String^ text = "Time = 12:00am temperature = 50";
   array<Byte>^data = System::Text::Encoding::UTF8->GetBytes( text );

   client->UploadDataCompleted += gcnew UploadDataCompletedEventHandler( UploadDataCallback3 );
   client->UploadDataAsync( uri, data );
}


public static void UploadDataInBackground3 (string address)
{
    WebClient client = new WebClient ();
    Uri uri = new Uri(address);
    string text = "Time = 12:00am temperature = 50";
    byte[] data = System.Text.Encoding.UTF8.GetBytes (text);

    client.UploadDataCompleted += new UploadDataCompletedEventHandler (UploadDataCallback3);
    client.UploadDataAsync (uri, data);
}

Public Shared Sub UploadDataInBackground3(ByVal address As String)

	Dim client As WebClient = New WebClient()
	Dim text As String = "Time = 12:00am temperature = 50"
	Dim data() As Byte = System.Text.Encoding.UTF8.GetBytes(text)
	AddHandler client.UploadDataCompleted, AddressOf UploadDataCallback3
                      Dim uri as Uri = New Uri(address)
	client.UploadDataAsync(uri, data)
End Sub

Comentarios

Este evento se provoca cada vez que finaliza una operación de carga asincrónica de datos.This event is raised each time an asynchronous data upload operation completes. Cargas de datos asincrónicas se inician mediante una llamada a la UploadDataAsync métodos.Asynchronous data uploads are started by calling the UploadDataAsync methods.

El UploadDataCompletedEventHandler es el delegado de este evento.The UploadDataCompletedEventHandler is the delegate for this event. La UploadDataCompletedEventArgs clase proporciona el controlador de eventos con datos de evento.The UploadDataCompletedEventArgs class provides the event handler with event data.

Para obtener más información acerca de cómo controlar eventos, vea controlar y provocar eventos.For more information about how to handle events, see Handling and Raising Events.

Se aplica a