Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This example shows how to request a Web page and retrieve the results in a stream.
Example
WebClient myClient = new WebClient();
Stream response = myClient.OpenRead("https://www.contoso.com/index.htm");
// The stream data is used here.
response.Close();
Dim myClient As WebClient = New WebClient()
Dim response As Stream = myClient.OpenRead("https://www.contoso.com/index.htm")
' The stream data is used here.
response.Close()
Compiling the Code
This example requires:
- References to the System.IO and System.Net namespaces.