引用來源
--
Imports System.Web
Imports System.Net.Sockets 'HttpWebRequest、HttpWebResponse類別
Imports System.Net
Imports System.IO 'StreamReader類別
在page_load事件裡加入以下
Dim request As HttpWebRequest = WebRequest.Create("http://tw.yahoo.com")
Dim mResponse As HttpWebResponse = request.GetResponse()
Dim sr As New StreamReader(mResponse.GetResponseStream, Encoding.GetEncoding("utf-8"))
' 可設定用什麼編碼來擷取
Dim strContent = sr.ReadToEnd()
sr.Close()
request = Nothing
mResponse = Nothing
Response.Write(strContent)
沒有留言:
張貼留言