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

Definizione

Si verifica al completamento di un'operazione asincrona di caricamento di stringhe.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 Event UploadStringCompleted As UploadStringCompletedEventHandler 

Esempi

Nell'esempio di codice riportato di seguito viene illustrata l'impostazione di un gestore eventi per questo 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

Commenti

Questo evento viene generato ogni volta che viene completata un'operazione asincrona di caricamento di una stringa.This event is raised each time an asynchronous string upload operation completes. I caricamenti di stringhe asincrone vengono avviati chiamando i metodi UploadStringAsync.Asynchronous string uploads are started by calling the UploadStringAsync methods.

Il UploadStringCompletedEventHandler è il delegato per questo evento.The UploadStringCompletedEventHandler is the delegate for this event. La classe UploadStringCompletedEventArgs fornisce il gestore eventi con i dati dell'evento.The UploadStringCompletedEventArgs class provides the event handler with event data.

Per altre informazioni su come gestire gli eventi, vedere la gestione e generazione di eventi.For more information about how to handle events, see Handling and Raising Events.

Si applica a