Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Como puedo Barrer el Contenido de un Directorio???? (https://www.clubdelphi.com/foros/showthread.php?t=25937)

AGAG4 08-10-2005 02:18:09

Como puedo Barrer el Contenido de un Directorio????
 
Necesito Barrer el contenido de un directorio algo similar como si fuese a barrer una Tabla de una base de datos para Subirlos al FTP Server por ejemplo:
Código Delphi [-]
While Not EOF(BuscaArchiDir) do begin
  Tomo Archivo;
  Lo Subo a FTP;
Siguiente Archivo;
end;

Agradezco cualquier sugerencia.

AGAG4 08-10-2005 02:59:45

Bueno ....
 
Ya la encontre... Aqui esta la respuesta
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);

 procedure RastreaDir(Dir: string);
 var
    FileSearch:  TSearchRec;
 begin
    chDir (Dir);
    FindFirst ('*.*', faDirectory, FileSearch);

    while FindNext(FileSearch)=0 do
    begin
      if (FileSearch.Attr = faDirectory) then
      begin
        if (FileSearch.Name<>'..') then RastreaDir(Dir+FileSearch.Name+'\');
      end else
        {Pon aqui lo que quieras hacer con los ficheros encontrados}
        {Put here anything to make with the find files}
        Memo1.Lines.Add(Dir+FileSearch.Name);
    end;
    FindClose(FileSearch);
 end;

 begin
   RastreaDir('c:\dlib\');
 end;

Saludos.... :)


La franja horaria es GMT +2. Ahora son las 15:23:10.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi