WebClient.OpenReadCompleted Event


Occurs when an asynchronous operation to open a stream containing a resource completes.

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

Event Type



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);
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)
End Sub


This event is raised each time an asynchronous operation to open a stream containing a resource completes. These operations are started by calling the OpenReadAsync methods.

The OpenReadCompletedEventHandler is the delegate for this event. The OpenReadCompletedEventArgs class provides the event handler with event data.

For more information about how to handle events, see Handling and Raising Events.

Applies to