请问高手:为什么有时用 Inet.OpenURL(strURL)不可读到网页内容,但用WebBrowser.Navigate (strURL) 方法却能正确显示网页谢谢,哪位高手帮帮忙!本人需要读到网页的内容并存入到一个文件中. 或者高手能讲解一下能否将WebBrowser.Navigate (strURL) 读到的内容存入到一个文件中.非常感谢.本人使用的是VB

解决方案 »

  1.   

    Inet.OpenURL(strURL)的速度慢一些加入timer,commandbutton,text
    private sub command1_click()
    webbrowser1.navigate http://www.sohu.com/
    timer1.enabled=true
    end subprivate sub timer1_timer()
    dim doc,objhtml as object
    dim i as integer
    dim strhtml as stringif not webbrowser1.busy then
    set doc=webbrowser1.document
    i=0
    set objhtml=doc.body.createtextrange()
    if not isnull(objhtml) then
    text1.text=objhtml.htmltext
    end if
    timer1.enabled=false
    end if
    end sub