下面是使用AutoUpgrader组件的代码:
unit Main;interfaceuses
Windows, Classes, Controls, Forms, StdCtrls, ComCtrls,
auAutoUpgrader, auHTTP;type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
AutoUpgraderPro1: TauAutoUpgrader;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
ProgressBar1: TProgressBar;
Label6: TLabel;
URLLabel1: TLabel;
URLLabel2: TLabel;
procedure Button1Click(Sender: TObject);
procedure AutoUpgraderPro1Aborted(Sender: TObject);
procedure URLLabel1Click(Sender: TObject);
procedure URLLabel2Click(Sender: TObject);
procedure AutoUpgraderPro1NoUpdateAvailable(Sender: TObject);
procedure AutoUpgraderPro1Progress(Sender: TObject;
const FileURL: string; FileSize, BytesRead, ElapsedTime,
EstimatedTimeLeft: Integer; PercentsDone, TotalPercentsDone: Byte;
TransferRate: Single);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}uses auUtils;procedure TForm1.Button1Click(Sender: TObject);
begin
AutoUpgraderPro1.CheckUpdate;
end;procedure TForm1.AutoUpgraderPro1Aborted(Sender: TObject);
begin
// upgrade aborted
Caption := 'Upgrade aborted';
ProgressBar1.Position := 0;
end;procedure TForm1.URLLabel1Click(Sender: TObject);
begin
OpenURL(URLLabel1.Caption, True);
end;procedure TForm1.URLLabel2Click(Sender: TObject);
begin
OpenURL(URLLabel2.Caption, True);
end; procedure TForm1.AutoUpgraderPro1NoUpdateAvailable(Sender: TObject);
begin
Caption := 'No Update';
end;procedure TForm1.AutoUpgraderPro1Progress(Sender: TObject;
const FileURL: string; FileSize, BytesRead, ElapsedTime,
EstimatedTimeLeft: Integer; PercentsDone, TotalPercentsDone: Byte;
TransferRate: Single);
begin
ProgressBar1.Position := PercentsDone;
end;被更新的文件名没有出现在属性设置中,而是在URLLabel1.Caption,请问OpenURL是什么?
unit Main;interfaceuses
Windows, Classes, Controls, Forms, StdCtrls, ComCtrls,
auAutoUpgrader, auHTTP;type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
AutoUpgraderPro1: TauAutoUpgrader;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
ProgressBar1: TProgressBar;
Label6: TLabel;
URLLabel1: TLabel;
URLLabel2: TLabel;
procedure Button1Click(Sender: TObject);
procedure AutoUpgraderPro1Aborted(Sender: TObject);
procedure URLLabel1Click(Sender: TObject);
procedure URLLabel2Click(Sender: TObject);
procedure AutoUpgraderPro1NoUpdateAvailable(Sender: TObject);
procedure AutoUpgraderPro1Progress(Sender: TObject;
const FileURL: string; FileSize, BytesRead, ElapsedTime,
EstimatedTimeLeft: Integer; PercentsDone, TotalPercentsDone: Byte;
TransferRate: Single);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}uses auUtils;procedure TForm1.Button1Click(Sender: TObject);
begin
AutoUpgraderPro1.CheckUpdate;
end;procedure TForm1.AutoUpgraderPro1Aborted(Sender: TObject);
begin
// upgrade aborted
Caption := 'Upgrade aborted';
ProgressBar1.Position := 0;
end;procedure TForm1.URLLabel1Click(Sender: TObject);
begin
OpenURL(URLLabel1.Caption, True);
end;procedure TForm1.URLLabel2Click(Sender: TObject);
begin
OpenURL(URLLabel2.Caption, True);
end; procedure TForm1.AutoUpgraderPro1NoUpdateAvailable(Sender: TObject);
begin
Caption := 'No Update';
end;procedure TForm1.AutoUpgraderPro1Progress(Sender: TObject;
const FileURL: string; FileSize, BytesRead, ElapsedTime,
EstimatedTimeLeft: Integer; PercentsDone, TotalPercentsDone: Byte;
TransferRate: Single);
begin
ProgressBar1.Position := PercentsDone;
end;被更新的文件名没有出现在属性设置中,而是在URLLabel1.Caption,请问OpenURL是什么?
解决方案 »
- 关于提问一个CreateMutex线程操作的问题
- 安装第三方控件
- 谁有dbctrlgrid使用的经验分享一下。主要是在每个面板(panle)中可以按不同的条件显示不同的颜色以方便区分
- TWordApplication调用WORD的问题?
- 关于事件调用程序的问题
- 急!急!急!在线,关于类型转换的问题。
- 为什么在安装了BCB6之后Delphi6的某些包在Delphi启动时不能加载?
- ADO问题——:”初始化提供者时发生错误,测试连接失败。无法启动应用程序。工作组信息文件丢失,或是已被其他用户以独占方式打开。”
- delphi中如何在Edit(或DBEdit)中填入一个角度?
- 怎么在delphi程序中建立project?
- delphi+Access保存数据丢失
- 什么控件可以同时编辑文字和图片?
是在这个控件包里的 打开 URL的一个函数。
把inf设置放在“虚拟”网络上,然后可以获得了。