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

Definition

Tritt ein, wenn ein asynchroner Zeichenfolgenupload abgeschlossen wird.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 

Beispiele

Das folgende Codebeispiel veranschaulicht das Festlegen von eines ereignishandlers für dieses Ereignis.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

Hinweise

Dieses Ereignis wird jedes Mal ausgelöst, wenn ein asynchroner Zeichenfolgenupload abgeschlossen wird.This event is raised each time an asynchronous string upload operation completes. Asynchrone Zeichenfolge hochgeladen werden gestartet, durch den Aufruf der UploadStringAsync Methoden.Asynchronous string uploads are started by calling the UploadStringAsync methods.

Die UploadStringCompletedEventHandler ist der Delegat für dieses Ereignis.The UploadStringCompletedEventHandler is the delegate for this event. Die UploadStringCompletedEventArgs Klasse stellt den Ereignishandler mit Ereignisdaten bereit.The UploadStringCompletedEventArgs class provides the event handler with event data.

Weitere Informationen zum Behandeln von Ereignissen finden Sie unter behandeln und Auslösen von Ereignissen.For more information about how to handle events, see Handling and Raising Events.

Gilt für: