如何将WebBrowser中当前页面的元素下载到本地硬盘?最好不要借助其它的控件,而是直接从WebBrowser中读取,这样速度应该会快很多。

解决方案 »

  1.   

    uses
      UrlMon;function DownloadFile(Source, Dest: string): Boolean;
    begin
      try
        Result := UrlDownloadToFile(nil, PChar(source), PChar(Dest), 0, nil) = 0;
      except
        Result := False;
      end;
    end;for example:DownloadFile('http://www.unknown.com/download/Beauty.swf', 'c:\test.swf');