Ich habe hier einen code, funtkioniert in Delphi problemlos:
Code: Alles auswählen
uses ..., ExtActns;
type
TForm1 = class(TForm)
ProgressBar1: TProgressBar;
procedure FormCreate(Sender: TObject);
private
procedure URL_OnDownloadProgress
(Sender: TDownLoadURL;
Progress, ProgressMax: Cardinal;
StatusCode: TURLDownloadStatus;
StatusText: String; var Cancel: Boolean) ;
public
{ Public declarations }
end;
...
procedure TForm1.URL_OnDownloadProgress;
begin
ProgressBar1.Max:= ProgressMax;
ProgressBar1.Position:= Progress;
end;
...
Procedure TForm1.FormCreate(sender: TObject);
begin
with TDownloadURL.Create(self) do
try
URL:='http://example.com/datei';
FileName := 'c:\SpeicherPfad';
OnDownloadProgress := self.URL_OnDownloadProgress;
ExecuteTarget(nil) ;
finally
Free;
end;
end;