unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
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}
form1.memo1.lines.add(Dir+FileSearch.Name);
end;
FindClose(FileSearch);
end;
begin
RastreaDir('f:\mp3\viejo\');
end;
end.
sábado, 12 de mayo de 2007
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario