我要保存的是图片用
rang.execCommand('Copy',False,0);
      image1.Picture.Assign(ClipBoard);
也不能解决

解决方案 »

  1.   

    用emb的webbrowser,好像有savetofile
      

  2.   

    EmbWebBrowser控件,delphi7可以装
      

  3.   

    EmbWebBrowser虽然是不错,不过仅仅为保存网页要用它没必要了,几行代码就可以做到的事情
    http://blog.csdn.net/sunstone/article/details/4788743
      

  4.   

    EmbWebBrowser试过了,不行哦,只能保存HTML文件,不能保存图片文件
      

  5.   

    直接用idhttp下载下来,urldowntofile下载不来说明服务器做了限制
      

  6.   

          
    //{ 真正获取WebBrowser源码,返回的是原始格式代码,区别于innerHTML }
    function GetHtml(const Document2: IHTMLDocument2): string;
    const
      BufSize = $10000;
    var
      Size: Int64;
      Stream: IStream;
      hHTMLText: HGLOBAL;
      psi: IPersistStreamInit;
    begin
      if not Assigned(Document2) then Exit;  OleCheck(Document2.QueryInterface
        (IPersistStreamInit, psi));
      try
      //OleCheck(psi.GetSizeMax(Size));
        hHTMLText := GlobalAlloc(GPTR, BufSize);
        if 0 = hHTMLText then SysUtils.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;//调用按钮事件
    procedure TForm1.ButtonViewSourcClick(Sender: TObject);
    begin
      Memo1.Text := GetHtml(WebBrowser1.Document as IHTMLDocument2);
    end;可以在OnDocumentComplete事件中判断WebBrowser1中的内容加载完毕,就可以用调用GetHtml函数进行显示,
    Memo1.Text赋值后,保存为文件直接Memo1.Lines.SaveToFile()就可以了。
      

  7.   

    我想获取的是验证码的图片。urldowntofile在7。0版的IE中可以下载,很郁闷。