Mono Class Library: System.Net.WebClient Overview | Members

System.Net.WebClient.OpenRead Method

Opens a readable System.IO.Stream containing the data downloaded from the resource identified by the specified URI. [Edit]

public System.IO.Stream OpenRead (string address)

Parameters

address
A string that specifies the URI from which data will be downloaded. [Edit]

Returns

A System.IO.Stream used to read data from a resource. [Edit]

Exceptions

TypeReason
System.Net.WebException

The absolute URI is not valid.

-or-

An error occurred while downloading data.

[Edit]

Remarks

If the WebClient.BaseAddress property of the current instance is not string.Empty, address is combined with WebClient.BaseAddress to form the absolute URI of the requested data. If the WebClient.BaseAddress property of the current instance is string.Empty, address is required to be the absolute URI of the requested data. If the WebClient.QueryString property of the current instance is not string.Empty, it is appended to address.

Note: This method creates a System.IO.Stream instance used to access the data specified by the absolute URI . The caller of this method is responsible for calling System.IO.Stream.Close to release the resources allocated for the stream.

[Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0