Ver Mensaje Individual
  #1  
Antiguo 19-03-2009
jhcaboverde jhcaboverde is offline
Miembro
 
Registrado: nov 2006
Posts: 61
Reputación: 18
jhcaboverde Va por buen camino
como agrego esta rutina a un treeview

Es decir lo que necesito es que al recorrer el directorio seleccionado agregue al treeview carpetas y archivos como si fuera un explorador

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('D:\');
end;

Última edición por jhcaboverde fecha: 19-03-2009 a las 18:05:17.
Responder Con Cita