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

Définition

Se produit lors d'une opération asynchrone de transfert de chaînes.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 

Exemples

L’exemple de code suivant illustre la définition d’un gestionnaire d’événements pour cet événement.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

Remarques

Cet événement est déclenché chaque fois qu'une opération de chargement asynchrone de chaîne se termine.This event is raised each time an asynchronous string upload operation completes. Les téléchargements asynchrones de chaînes sont démarrés en appelant le UploadStringAsync méthodes.Asynchronous string uploads are started by calling the UploadStringAsync methods.

Le UploadStringCompletedEventHandler est le délégué de cet événement.The UploadStringCompletedEventHandler is the delegate for this event. Le UploadStringCompletedEventArgs classe fournit le Gestionnaire d’événements avec les données d’événement.The UploadStringCompletedEventArgs class provides the event handler with event data.

Pour plus d’informations sur la façon de gérer les événements, consultez gestion et déclenchement d’événements.For more information about how to handle events, see Handling and Raising Events.

S’applique à