Procedura: Richiedere una pagina Web e recuperare i risultati sotto forma di flussoHow to: Request a Web Page and Retrieve the Results as a Stream

Questo esempio mostra come richiedere una pagina Web e recuperare i risultati in un flusso.This example shows how to request a Web page and retrieve the results in a stream.

EsempioExample

WebClient myClient = new WebClient();  
Stream response = myClient.OpenRead("http://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("http://www.contoso.com/index.htm")  
' The stream data is used here.  
response.Close()  

Compilazione del codiceCompiling the Code

L'esempio presenta i requisiti seguenti:This example requires:

Vedere ancheSee Also

Richiesta di datiRequesting Data