Hallo,
für den Fortschritt kannst Du doch OnStatus, OnWorkBegin, OnWork und OnWorkEnd benutzen. Habe mal eben was zusammengedaddelt:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
Screen.Cursor := crHourGlass;
Memo1.Lines.Clear;
IdHTTP.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
IdHttp.HandleRedirects := True;
IdHTTP.Head(Edit1.text);
IdHTTP.Get(Edit1.text);
IdHTTP.Disconnect;
Screen.Cursor := crDefault;
end;
procedure TForm1.IdHTTPStatus(ASender: TObject; const AStatus: TIdStatus; const AStatusText: String);
begin
Statusbar1.SimpleText := AStatusText;
Memo1.Lines.Add(AStatusText);
end;
procedure TForm1.IdHTTPWorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer);
begin
ProgressBar1.Max := AWorkCountMax;
Memo1.Lines.Add('WorkBegin: WorkCountMax: ' + IntToStr(AWorkCountMax));
end;
procedure TForm1.IdHTTPWork(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer);
begin
ProgressBar1.Position := AWorkCount;
Memo1.Lines.Add('WorkCount: ' + IntToStr(AWorkCount));
end;
procedure TForm1.IdHTTPWorkEnd(Sender: TObject; AWorkMode: TWorkMode);
begin
Memo1.Lines.Add('WorkEnd:');
Statusbar1.SimpleText := 'Habe fertig';
end;
In der Progressbar sieht man schön den Balken laufen.
[edit]hat Schreibfehler gefunden[/edit]