Ver Mensaje Individual
  #9  
Antiguo 17-06-2008
[coso] coso is offline
Miembro Premium
 
Registrado: may 2008
Ubicación: Girona
Posts: 1.678
Reputación: 0
coso Va por buen camino
Ok te entendi mal. Debes usar recursividad :

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
        st : TStringList;
begin
        st := TStringList.Create;
        AddPath('o:\temp',st);
        ListBox1.Items.Text := st.Text;
        st.Free;
end;
procedure TForm1.AddPath(s : string; st : TStringList);
var
  SR: TSearchRec;
begin

    if s[Length(s)]<>'\' then s := s + '\';
    if FindFirst(s+'*.*', faAnyFile, SR) <> 0 then exit; 

    repeat
       if (SR.Attr <> faDirectory) then st.Add(s+SR.Name);
       if (SR.Attr = faDirectory) and (SR.Name <> '..') and (SR.Name <> '.') then AddPath(s+SR.Name,st);
    until FindNext(SR)<>0;

    FindClose(SR);
end;

saludos
Responder Con Cita