比如,我的网站上有一个文件:http://localhost/abc.exe,那么,怎样用程序把abc.exe拷贝到我机器C盘上呢?

解决方案 »

  1.   

    Uses URLMon, ShellApi;
    function DownloadFile(SourceFile, DestFile: string): Boolean;
    begin
      try
        Result :=  UrlDownloadToFile(nil, PChar(SourceFile), PChar(DestFile), 0, nil) = 0;
      except
        Result := False;
      end;
    end;SourceFile就是http://localhost/abc.exe
    DestFile就是你的C盘的路径和想保存的文件名
      

  2.   

    linzhengqun(风。为菜鸟服务):我用了果然好用!我靠,这位老弟真牛啊,不知道你是怎么掌握这个知识的?
      

  3.   

    多看看吧,还有其它方法,比如用数据流来处理 MEMORYSTREAM