自己做了个浏览器(用Twebbrowser),想做一个保存网业的功能,就是把打开的网业保存成HTML文件,还有要把网业的图片也保存下来。怎么做?大家帮帮忙?

解决方案 »

  1.   

    webbrowser.ExecWB(OLECMDID_SAVEAS,
                      OLECMDEXECOPT_DODEFAULT,
                      EmptyParam,EmptyParam);
      

  2.   

    上面的是弹出对话框的,下面存源码的
    uses
      MSHTML;procedure Tfm.BitBtn1Click(Sender: TObject);
    var
      tsl: TStringList;
      HTMLDocument: IHTMLDocument2;  htmlstr:string;
    begin
       HTMLDocument:= web.Document as IHTMLDocument2;
       htmlstr:=HTMLDocument.body.outerHTML;
       try
         tsl:= TStringList.Create;
         tsl.Append(htmlstr);
         tsl.SaveToFile('c:\report.htm');
       finally
          tsl.Free;
       end;
    end;
      

  3.   

    happyggy(Delphi<-&&->java) 成功了,谢谢。