Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
fs: TFileStream;
begin
fs := TFileStream.Create('c:\test.zip', fmCreate );
try
IdHTTP1.Get('http://melander.dk/download/DragDrop0401rc3.zip', fs);
finally
fs.Free;
end;
end;
procedure TForm1.IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
begin
Progressbar1.Position := AWorkCount;
end;
procedure TForm1.IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
TickStart := GetTickCount;
ProgressBar1.Max := AWorkCountMax;
end;
procedure TForm1.IdHTTP1WorkEnd(Sender: TObject; AWorkMode: TWorkMode);
begin
ShowMessage(IntToStr(GetTickCount - TickStart)+ ' ms');
end;
Ca. 2 Sekunden für die 999 kB. Es liegt also nicht am Download.