WebClient.UploadStringCompleted WebClient.UploadStringCompleted WebClient.UploadStringCompleted WebClient.UploadStringCompleted Event

Definición

Se produce cuando se completa una operación de carga de cadenas asincrónica.Occurs when an asynchronous string-upload operation completes.

public:
 event System::Net::UploadStringCompletedEventHandler ^ UploadStringCompleted;
public event System.Net.UploadStringCompletedEventHandler UploadStringCompleted;
member this.UploadStringCompleted : System.Net.UploadStringCompletedEventHandler 
Public Custom Event UploadStringCompleted As UploadStringCompletedEventHandler 

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 UploadStringInBackground2( String^ address )
{
   WebClient^ client = gcnew WebClient;
   Uri ^uri = gcnew Uri(address);
   String^ data = "Time = 12:00am temperature = 50";

   client->UploadStringCompleted += gcnew UploadStringCompletedEventHandler( UploadStringCallback2 );
   client->UploadStringAsync( uri, data );
}


public static void UploadStringInBackground2 (string address)
{
    WebClient client = new WebClient ();
    Uri uri = new Uri(address);
    string data = "Time = 12:00am temperature = 50";
    client.UploadStringCompleted += new UploadStringCompletedEventHandler (UploadStringCallback2);
    client.UploadStringAsync (uri, data);
}

Public Shared Sub UploadStringInBackground2(ByVal address As String)

	Dim client As WebClient = New WebClient()
	Dim data As String = "Time = 12:00am temperature = 50"
	AddHandler client.UploadStringCompleted, AddressOf UploadStringCallback2
                      Dim uri as Uri = New Uri(address)
	client.UploadStringAsync(uri, data)
End Sub

Comentarios

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

El UploadStringCompletedEventHandler es el delegado de este evento.The UploadStringCompletedEventHandler is the delegate for this event. La UploadStringCompletedEventArgs clase proporciona el controlador de eventos con datos de evento.The UploadStringCompletedEventArgs 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