How to Get a html page content using Inet in vb6 and put the content in a TextBox?

后端 未结 3 747
没有蜡笔的小新
没有蜡笔的小新 2021-01-25 08:19

How to Get a html page content using Inet in vb6 and put the content in a TextBox ?

3条回答
  •  太阳男子
    2021-01-25 09:03

    Try this:

    Function GetHTMLCode(Optional strURL As String) As String
        Dim objHttp As Object, strText As String
        Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
        objHttp.Open "GET", strURL, False
        objHttp.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
        objHttp.Send ("")
        strText = objHttp.responseText
        Set objHttp = Nothing
        GetHTMLCode = strText
    End Function
    

    OK?)

提交回复
热议问题