UploadStringCompletedEventArgs UploadStringCompletedEventArgs UploadStringCompletedEventArgs UploadStringCompletedEventArgs Class

Definición

Proporciona datos para el evento UploadStringCompleted.Provides data for the UploadStringCompleted event.

public ref class UploadStringCompletedEventArgs : System::ComponentModel::AsyncCompletedEventArgs
public class UploadStringCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
type UploadStringCompletedEventArgs = class
    inherit AsyncCompletedEventArgs
Public Class UploadStringCompletedEventArgs
Inherits AsyncCompletedEventArgs
Herencia
UploadStringCompletedEventArgsUploadStringCompletedEventArgsUploadStringCompletedEventArgsUploadStringCompletedEventArgs

Ejemplos

En el ejemplo de código siguiente se muestra la carga asincrónica de una cadena.The following code example demonstrates asynchronously uploading a string.

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

El siguiente método se llama cuando se complete la carga.The following method is called when the upload completes.

void UploadStringCallback2( Object^ /*sender*/, UploadStringCompletedEventArgs^ e )
{
   String^ reply = dynamic_cast<String^>(e->Result);
   Console::WriteLine( reply );
}


private static void UploadStringCallback2 (Object sender, UploadStringCompletedEventArgs e)
{
        string reply = (string)e.Result;
        Console.WriteLine (reply);
}
Private Shared Sub UploadStringCallback2(ByVal sender As Object, ByVal e As UploadStringCompletedEventArgs)
    Dim reply As String = CStr(e.Result)
    Console.WriteLine(reply)
End Sub

Comentarios

Las instancias de esta clase se pasan a la UploadStringCompletedEventHandler.Instances of this class are passed to the UploadStringCompletedEventHandler.

Propiedades

Cancelled Cancelled Cancelled Cancelled

Obtiene un valor que indica si se ha cancelado una operación asincrónica.Gets a value indicating whether an asynchronous operation has been canceled.

(Inherited from AsyncCompletedEventArgs)
Error Error Error Error

Obtiene un valor que indica el error que se produjo durante una operación asincrónica.Gets a value indicating which error occurred during an asynchronous operation.

(Inherited from AsyncCompletedEventArgs)
Result Result Result Result

Obtiene la respuesta del servidor a la operación de carga de cadena iniciada mediante la llamada a un método UploadStringAsync.Gets the server reply to a string upload operation that is started by calling an UploadStringAsync method.

UserState UserState UserState UserState

Obtiene el identificador único de la tarea asincrónica.Gets the unique identifier for the asynchronous task.

(Inherited from AsyncCompletedEventArgs)

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
RaiseExceptionIfNecessary() RaiseExceptionIfNecessary() RaiseExceptionIfNecessary() RaiseExceptionIfNecessary()

Genera una excepción proporcionada por el usuario si se ha producido un error en una operación asincrónica.Raises a user-supplied exception if an asynchronous operation failed.

(Inherited from AsyncCompletedEventArgs)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a