怎么什么都要空间啊
给你个例子先,递规查找文件的
procedure FileSearch(PathName:string);
var
F : TSearchRec;
Found : Boolean;
begin
ChDir(PathName);
Found := (FindFirst('*.*', faAnyFile, F) = 0);
while Found do
begin
if (F.Name = '.') or (F.Name = '..') then
begin
Found := (FindNext(F) = 0);
Continue;
end;
if (F.Attr and faDirectory)>0 then
begin
Application.ProcessMessages;
FileSearch(F.Name);
end;
//插入你的代码,F.Name就是文件名,GetCurrentDir可以得到当前目录
Found := (FindNext(F) = 0);
end;
FindClose(F);
ChDir('../');
end;