abend,
Delphi-Quellcode:
procedure TForm1.IdFTP1OnWorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
sTime:=Now;
end;
zeigt mir immer noch nicht den richtigen speed an
was kann ich noch falsch gemacht haben
mfg
Delphi-Quellcode:
procedure TForm1.IdFTP1Work(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
Var
S: String;
TotalTime: TDateTime;
H, M, Sec, MS: Word;
DLTime: Double;
begin
//Errechnen der Transfergeschwindigkeit:
TotalTime := Now - STime;
DecodeTime(TotalTime, H, M, Sec, MS);
Sec := Sec + M * 60 + H * 3600;
DLTime := Sec + MS / 1000;
if DLTime > 0 then
AverageSpeed := (AWorkCount / 1024) / DLTime;
S := FormatFloat('0.00 KB/s', AverageSpeed);
case AWorkMode of
wmRead: GroupBox3.Caption :=' DownloadSpeed - ' + S; // hier würd ich es gern in der ProgressBar1 anzeigen lassen
end;
//Aktualisieren der Fortschrittsanzeige:
ProgressBar1.Position := AWorkCount;
end;
procedure TForm1.IdFTP1OnWorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
sTime:=Now;
end;
Delphi-Quellcode:
private
{ Private declarations }
STime:TDateTime;
public
{ Public declarations }
end;
var
Form1: TForm1;
MyIni : TIniFile;
ListItem: TListItem;
AverageSpeed:Double=0;
implementation