Fórum PROCURAR ARQUIVOS #155194
16/04/2003
0
Desde já agradeço a atenção
Jcsc2
Curtir tópico
+ 0Posts
16/04/2003
Jsalgado
Aí vai uma rotina que uso p/ fazer backup, está diminuida p/ atender ao que vc pediu.
Qq dúvida mande mail: jsalgado@netcabo.pt
Abraços.
JSalgado
Gostei + 0
16/04/2003
Jsalgado
Esqueci de anexar a rotina, desculpe.
procedure ScanDir(const Path: String);
var
SR: TSearchRec;
APath: String;
begin
Application.ProcessMessages;
APath := IncludeTrailingBackslash(Path);
fMain.edList.Text := Path;
fMain.edList.Refresh;
if FindFirst(APath + ´*´, faAnyFile, SR) = 0 then
begin
repeat
if SR.Attr and faDirectory = 0 then fMainS.VeArq (APath + SR.Name);
until FindNext(SR) > 0;
FindClose(SR);
end;
if FindFirst(APath + ´*´, faAnyFile, SR) = 0 then
begin
repeat
if (SR.Name > ´.´) and (SR.Name > ´..´) then ScanDir(APath + SR.Name);
until FindNext(SR) > 0;
FindClose(SR);
end;
end;
procedure TfMain.VeArq(const Filename: String);
begin
Application.ProcessMessages;
if not (SameText(ExtractFileExt(Filename), xext)) then
begin
Exit;
end;
edList.Text := filename;
edList.Refresh;
end;
É só colocar depois uma ativação da rotina onde:
xext := ´.txt´;
ScanDir(´c:\´);
Gostei + 0
16/04/2003
Jcsc2
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)