function DownloadFile(Source, Dest: string): Boolean;
begin
    try
        Result := UrlDownloadToFile(nil, PChar(source), PChar(Dest), 0, nil) = 0;
    except
        Result := False;
    end;
end;


procedure TForm1.btn2Click(Sender: TObject);
var
    SourceFile,DestFile:string;
begin
    SourceFile := 'http://www.baidu.com/';
    DestFile := 'c:/12ab.htm';
    DownloadFile(SourceFile, DestFile);
end;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案