本文来自http://blog.youkuaiyun.com/hellogv/
procedure TSysClass.FindAll(path: String; var fileresult: TStrings);//查找文件 ,path不带'/'
var
fpath,s: String;
fs: TsearchRec;
i:integer;
begin
fpath:=path+'/*.*';
if FindFirst(fpath,faAnyFile,fs)=0 then
begin
if (fs.Name<>'.')and(fs.Name<>'..') then
if (fs.Attr and faDirectory)=faDirectory then
findall(path+'/'+fs.Name,fileresult)
else
fileresult.add(path+'/'+fs.Name);
while findnext(fs)=0 do
begin
if (fs.Name<>'.')and(fs.Name<>'..') then
if (fs.Attr and faDirectory)=faDirectory then
Findall(path+'/'+fs.Name,fileresult)
else begin
fileresult.add(path+'/'+fs.Name);
end;
end;
end;
Findclose(fs);
end;