共用方式為


How to: Request a Web Page and Retrieve the Results as a Stream

This example shows how to request a Web page and retrieve the results in a stream.

範例

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()

編譯程式碼

This example requires:

請參閱

概念

Requesting Data