none
vb.net 获取网页源文件 RRS feed

答案

  • 我们可以用webrequest,webresponse来获网页中的源文件,下面是一个简单的例子:
    Dim objHttpRequest As System.Net.HttpWebRequest
                Dim objHttpResponse As System.Net.HttpWebResponse
                objHttpRequest = System.Net.HttpWebRequest.Create(strPage)
                objHttpResponse = objHttpRequest.GetResponse
                Dim objStrmReader As New StreamReader(objHttpResponse.GetResponseStream)

                strReply = objStrmReader.ReadToEnd()


    详细的示例和代码请看下面的文档:
    http://www.codeproject.com/KB/vb/GetHTML.aspx
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    2009年9月15日 8:16
    版主