![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
#1
|
|||
|
|||
|
Busqueda recursiva
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;
Si acepta c\aplicacion\ No acepta \\maquina\c\aplicacion\ ¿Tengo que cambiar algo en mi código? Gracias Saludos
__________________
La victoria tiene cien padres. La derrota es huérfana (Napoleón). |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|