unit Unit1;
interface
uses
Windows, Messages, SysUtils,
Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtActns,
ComCtrls;
type
TForm1 = class(TForm)
ProgressBar1:
TProgressBar;
Label1: TLabel;
Button1: TButton;
procedure
FormCreate(Sender: TObject);
procedure Button1Click(Sender:
TObject);
private
{ Private declarations }
DownLoadURL :
TDownLoadURL;
procedure DownloadProgress(Sender: TDownLoadURL;
Progress,
ProgressMax: Cardinal; StatusCode: TURLDownloadStatus; StatusText:
String;
var Cancel: Boolean);
public
{ Public declarations
}
end;
var
Form1: TForm1;
implementation
{$R
*.dfm}
procedure TForm1.DownloadProgress(Sender: TDownLoadURL;
Progress,
ProgressMax: Cardinal; StatusCode:
TURLDownloadStatus;
StatusText: String; var Cancel:
Boolean);
begin
Label1.Caption := StatusText;
ProgressBar1.Max :=
ProgressMax;
ProgressBar1.Position := Progress;
end;
procedure
TForm1.FormCreate(Sender: TObject);
begin
DownLoadURL :=
TDownLoadURL.Create(self);
with DownLoadURL do
begin
FileName :=
‘c:\p.exe‘;
URL :=
‘http://www.teechart.net/files/vcl/public/TeeChartPro6/TeeChart601Delphi6_RTL3.EXE‘;
OnDownloadProgress
:= DownloadProgress;
end;
end;
procedure
TForm1.Button1Click(Sender:
TObject);
begin
DownLoadURL.ExecuteTarget(DownLoadURL);
end;
相关文章
- 11-11maven下载的jar文件出现invalid LOC header (bad signature)
- 11-11SpringBoot下载Excel文件,在Wps上可以打开但是Office上的excel打不开的问题
- 11-11文件下载的大小
- 11-11成功解决Git Bash运行脚本命令下载文件到默认C盘路径的问题
- 11-11springboot项目下载文件功能中-切面-导致的下载文件失败的bug
- 11-11简单的文件下载模板
- 11-11SpringMVC的文件上传与下载。
- 11-11使用response实现文件的下载
- 11-11PrintWriter与ServletOutputStream的区别之文件下载
- 11-11iconfont下载的本地文件的ttf、woff、woff2转换成base64位后引入iconfont.css使用