Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi IdFTP AWorkCountMax = 0 (https://www.delphipraxis.net/24588-idftp-aworkcountmax-%3D-0-a.html)

Daradon 23. Jun 2004 12:25


IdFTP AWorkCountMax = 0
 
Hi

Ich versuch mich gerade an einem kleinen ftp programm :stupid:
Download usw funktioniert schon, nur ich habe hier das problem das
AWorkCountMax immer 0 ist.. mache ich irgendetwas beim verbinden falsch ? oder brauch ich ein list um die dateigröße zu erfahren ?

Delphi-Quellcode:
procedure TForm1.IdFTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
  const AWorkCountMax: Integer);
begin
ProgressBar1.Max := AWorkCountMax;
ProgressBar1.Position := 0;
Label12.Caption := IntToStr(AWorkCountMax div 1024);
Application.ProcessMessages;
end;
noch ne kleine frage:
Wie kann ich ambesten während eines transfers den transfer sauber abbrechen ?

Pierre 27. Jun 2004 10:27

Re: IdFTP AWorkCountMax = 0
 
Hallo,
mit ....
Code:
procedure TForm9.IdFTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
  const AWorkCountMax: Integer);
begin
  if AWorkCountMax > 0 then ProgressBar1.Max := AWorkCountMax
  else ProgressBar1.Max := BytesToTransfer;
end;
umgehe ich dieses Problem mit dem AWorkCountMax = 0.

mit....
Code:
procedure TForm9.IdFTP1Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer);
begin
  ProgressBar1.Position := AWorkCount;
  if Abbruch then IdFTP1.Abort;
end;
breche ich einen Transfervorgang ab, wenn ich den Boolean-Wert Abbruch auf true setze.

Gruß Pierre

S - tefano 27. Jun 2004 10:41

Re: IdFTP AWorkCountMax = 0
 
@Pierre:

Wo holst du dir denn BytesToTransfer her, wenn AWorkCountMax = 0 ist?

Pierre 27. Jun 2004 20:32

Re: IdFTP AWorkCountMax = 0
 
Richtig, hatte ich übersehen:
Code:
var
BytesToTransfer: LongWord;
und im Downloadbereich:
Code:
BytesToTransfer := IdFTP1.Size(DATEINAME);
mit DATEINAME als Donwloadfile

Gruß Pierre

S - tefano 27. Jun 2004 20:52

Re: IdFTP AWorkCountMax = 0
 
Aaaaachso; gut so mach ich es auch. Ich dachte schon es gäb durch ne neue Version irgendeine zusätzliche Eigenschaft oder so...


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz