Thema: Delphi IDFtp + Download +Dir

Einzelnen Beitrag anzeigen

horst

Registriert seit: 1. Jul 2003
347 Beiträge
 
Delphi 2007 Professional
 
#13

Re: IDFtp + Download +Dir

  Alt 10. Nov 2003, 17:50
mittlerweile mache ich es so,
das mit dem fileexists funktioniert aber auch hier nicht..

Delphi-Quellcode:
procedure TForm1.Button2Click(Sender: TObject);
var
  i: Integer;
  MyListing: TStringList;
begin
  if TransferringData then Form1.idFTP1.Abort;
  if Form1.IdFTP1.Connected then Form1.IdFTP1.Disconnect;
  try
    with IdFTP1 do begin
      Connect;
      if Connected then begin
        ChangeDir('/test/leer/');
        MyListing := TStringList.Create;
        List(MyListing, '*.txt', True);

        for i := 0 to DirectoryListing.Count - 1 do
          with DirectoryListing[i] do begin

            Application.ProcessMessages;
            ProgressBar1.Max := Size;
            Label1.Caption := 'Downloading ' + FileName + ' (' + IntToStr(Size) + ' bytes)';
            if FileExists(Filename) then
              Continue;
            Get(FileName, DestinationFolder + '\' + FileName, True, True);
          end;
        Disconnect;
        ProgressBar1.Max := 0;
        Label1.Caption := '';
      end; end;
  except;
  end;
end;
  Mit Zitat antworten Zitat