使用HttpWebRequest获得URL的返回值

类别:.NET开发 点击:0 评论:0 推荐:

'使用HttpWebRequest获得URL的返回值

Function GetUrlValue(ByVal Url As String) As String

    Dim HttpWebRequest As System.Net.WebRequest = System.Net.WebRequest.Create(Url)

 

    Dim HttpWebResponse As System.Net.WebResponse = HttpWebRequest.GetResponse()

    Dim HttpStreamReader As New System.IO.StreamReader(HttpWebResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312"))

 

    Return HttpStreamReader.ReadToEnd

End Function

本文地址:http://com.8s8s.com/it/it43902.htm