WebRequest 创建 WebResponse 实例....取得别站网页内容。
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
' Initialize the WebRequest.
Dim myRequest As WebRequest = WebRequest.Create("http://www.163.com")
' Return the response.
Dim myResponse As WebResponse = myRequest.GetResponse()
' Code to use the WebResponse goes here.
' Close the response to free resources.
Dim resStream As Stream = myResponse.GetResponseStream()
Dim sr As New StreamReader(resStream, Encoding.UTF8)
Dim str1 As String = sr.ReadToEnd()
myResponse.Close()
TextBox1.Text = str1
'在此处放置初始化页的用户代码
' Initialize the WebRequest.
Dim myRequest As WebRequest = WebRequest.Create("http://www.163.com")
' Return the response.
Dim myResponse As WebResponse = myRequest.GetResponse()
' Code to use the WebResponse goes here.
' Close the response to free resources.
Dim resStream As Stream = myResponse.GetResponseStream()
Dim sr As New StreamReader(resStream, Encoding.UTF8)
Dim str1 As String = sr.ReadToEnd()
myResponse.Close()
TextBox1.Text = str1