vb.net下載網頁html程式碼
If txturl.Text = "" Then
Page.RegisterStartupScript("msg", "<script>alert('網址不能為空!')</script>")
Else
pageurl = txturl.Text
Dim request As WebRequest = request.Create(pageurl)
Dim response As WebResponse = request.GetResponse
Dim resStream As Stream
resStream = response.GetResponseStream
Dim rs As StreamReader
rs = New StreamReader(resStream, System.Text.Encoding.UTF8)
TextBox2.Text = rs.ReadToEnd
rs.Close()
End If
End Sub