我在form里加了个button,webBorwer,想浏览页面后将显示的页面内容存储下来,实现保存的功能,保存在自己的机子上,所以我引入了mshtml,可是当我在button_onclick打下
mshtml.HTMLDocumentClass doc = (mshtml.HTMLDocumentClass)webBrowser1.Document;时他就提示错误.错误 1 无法将类型“System.Windows.Forms.HtmlDocument”转换为“mshtml.HTMLDocumentClass” F:\毕业设计\ahnan\ahnan\Form2.cs 86 44 ahnan希望知道的高人请给与指教。必将感激不尽!!!多谢。

解决方案 »

  1.   

    就这么一句
     ExecCommandID(SHDocVw.OLECMDID.OLECMDID_SAVEAS);
      

  2.   

    webBorwer自己有保存对话框,调用它就是网页另存为,根在IE中的一样。
      

  3.   

    如果仅仅是想获得页面中的内容,不存页面中得图片等也可以用documentText或documentstream
      

  4.   

    如果仅仅是想获得页面中的内容,不存页面中得图片等也可以用documentText或documentstream
    ---学习/
      

  5.   

    webBrowser1.Document.ExecCommand("SaveAs", true, "");