Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 29-12-2003
Descendents Descendents is offline
Miembro
 
Registrado: may 2003
Ubicación: Barcelona
Posts: 396
Poder: 24
Descendents Va por buen camino
Código:
 procedure TForm1.BuscaFicheros(path, mask : AnsiString; var Value : TStringList; brec : Boolean);
 var
   srRes : TSearchRec;
   iFound : Integer;
 begin
   if ( brec ) then
     begin
     if path[Length(path)] <> '\' then path := path +'\';
     iFound := FindFirst( path + '*.*', faAnyfile, srRes );
     while iFound = 0 do
       begin
       if ( srRes.Name <> '.' ) and ( srRes.Name <> '..' ) then
         if srRes.Attr and faDirectory > 0 then
           BuscaFicheros( path + srRes.Name, mask, Value, brec );
       iFound := FindNext(srRes);
       end;
     FindClose(srRes);
     end;
   if path[Length(path)] <> '\' then path := path +'\';
   iFound := FindFirst(path+mask, faAnyFile-faDirectory, srRes);
   while iFound = 0 do
     begin
     if ( srRes.Name <> '.' ) and ( srRes.Name <> '..' ) and ( srRes.Name <> '' ) then
       Value.Add(path+srRes.Name);
     iFound := FindNext(srRes);
     end;
   FindClose( srRes );
 end;

lo llamas asi

Código:
 procedure TForm1.Button1Click(Sender: TObject);
 var
    Ficheros:TStringList;
 begin
   Ficheros:=TStringList.Create;
   BuscaFicheros('c:\delphi3\','*.*',Ficheros,TRUE);
   Memo1.Lines.Assign(Ficheros);
   Ficheros.Free;
 end;
Esta sacado del trucomania

Con este procedimiento los localizas, y los eliminas o lo que quieras

Saludos
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 09:28:57.


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