可以得到http地址后用TNMHTTP控件得到HTML,就可以保存了。呵呵。
用WebBrowser我就不会,不过WebBrowser有一个Document属性,可能可以通过它来保存 。

解决方案 »

  1.   

    WebBrowser1.Navigate (edit1.text);
      

  2.   

    我知道了哈哈,kxy告诉我的,不过自己不能回答自己的问题,哎。
      

  3.   

    WebBrowser的(IHTMLDocument2 as IPersistFile).Save
      

  4.   

    请问,IPersistFile 之前,要 USES 什么东西呀?
      

  5.   

    一种方案
    //读WEBBROWSER中的文本内容,uses ActiveX,ComObj;function GetHtml(const WebBrowser:TWebBrowser): string;
    const
      BufSize = $10000;
    var
      Size: Int64;
      Stream: IStream;
      hHTMLText: HGLOBAL;
      psi: IPersistStreamInit;
    begin
      if not Assigned(WebBrowser.Document) then Exit;  OleCheck(WebBrowser.Document.QueryInterface
      (IPersistStreamInit, psi));
      try
      //OleCheck(psi.GetSizeMax(Size));
        hHTMLText := GlobalAlloc(GPTR, BufSize);
        if 0 = hHTMLText then RaiseLastWin32Error;    OleCheck(CreateStreamOnHGlobal(hHTMLText,
        True, Stream));
        try
          OleCheck(psi.Save(Stream, False));      Size := StrLen(PChar(hHTMLText));
          SetLength(Result, Size);
          CopyMemory(PChar(Result), Pointer(hHTMLText), Size);
        finally
          Stream := nil;
        end;
      finally
        psi := nil;
      end;
    end;第二种
    //调用WEBBROWSER的SAVE方法
      WebBrowser.ExecWB(OLECMDID_SAVEAS,0);
      

  6.   

    怎样保存到程序指定的路径,不弹出保存对话框呀,我试着把OLECMDID_saveas改成OLECMDID_save
    执行时没有报错,可实际上根本就没有保存。