private AxWebBrowser webBrowser;
IHTMLDocument2 doc=(IHTMLDocument2)this.webBrowser.Document;//错误,如何修改?

解决方案 »

  1.   

    跟入看了下,上面那句没错, 这里报错:  IHTMLFramesCollection2 frames = tempWeb.parentWindow.frames;
    提示Specified cast is not valid.
      

  2.   

    tempWeb.parentWindow.frames的类型不是IHTMLFramesCollection2 吧!
      

  3.   

    object j;
    HTMLDocument doc = (HTMLDocument)webBrowser1.Document.DomDocument;
    HTMLWindow2Class frame = doc.parentWindow.frames.item(ref j) as HTMLWindow2Class;
    http://topic.csdn.net/u/20091122/22/521caf78-eea6-4b1a-b904-c58a2fe50215.html
      

  4.   

    wuyq11 :看好,webbrowser 不是system.windows.forms.webbrowser
      

  5.   

    The problem is you can't make calls from outside the thread that created the Document object. In other words, you must make Document calls from within the same thread.So instead of threadpool, gonna have to fake it with some kind of array of STA threads. Ugh...!
    好像是线程问题