WebClient.OpenReadCompleted WebClient.OpenReadCompleted WebClient.OpenReadCompleted WebClient.OpenReadCompleted Event

Definición

Se produce cuando finaliza una operación asincrónica para abrir una secuencia que contiene un recurso.Occurs when an asynchronous operation to open a stream containing a resource completes.

public:
 event System::Net::OpenReadCompletedEventHandler ^ OpenReadCompleted;
public event System.Net.OpenReadCompletedEventHandler OpenReadCompleted;
member this.OpenReadCompleted : System.Net.OpenReadCompletedEventHandler 
Public Custom Event OpenReadCompleted As OpenReadCompletedEventHandler 

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 OpenResourceForReading2( String^ address )
{
   WebClient^ client = gcnew WebClient;
   Uri ^uri = gcnew Uri(address);

   client->OpenReadCompleted += gcnew OpenReadCompletedEventHandler( OpenReadCallback2 );
   client->OpenReadAsync( uri );
}


public static void OpenResourceForReading2 (string address)
{
    WebClient client = new WebClient ();
    Uri uri = new Uri(address);

    client.OpenReadCompleted += new OpenReadCompletedEventHandler(OpenReadCallback2);
    client.OpenReadAsync (uri);
}

Public Shared Sub OpenResourceForReading2(ByVal address As String)

	Dim client As WebClient = New WebClient()
	AddHandler client.OpenReadCompleted, AddressOf OpenReadCallback2
                      Dim uri as Uri = New Uri(address)
	client.OpenReadAsync(uri)                        
End Sub

Comentarios

Este evento se provoca cada vez que finaliza una operación asincrónica para abrir una secuencia que contiene un recurso.This event is raised each time an asynchronous operation to open a stream containing a resource completes. Estas operaciones se inician mediante una llamada a la OpenReadAsync métodos.These operations are started by calling the OpenReadAsync methods.

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