就是查找该目录下的所有文件了,用这个函数,自己改改用
procedure findall(disk,path: String;
var fileresult: Tstrings);
var
fpath: String;
fs: TsearchRec;
begin
fpath:=disk+path+'/*.*';
if findfirst(fpath,faAnyFile,fs)=0 then
begin
if (fs.Name<>'.')and(fs.Name<>'..') then
if (fs.Attr and faDirectory)=faDirectory then
findall(disk,path+'/'+fs.Name,fileresult)
else
fileresult.add(disk+strpas(strupper(pchar(path)))+'/'+strpas(
strupper(pchar(fs.Name)))+'('+inttostr(fs.Size)+')');
while findnext(fs)=0do
begin
if (fs.Name<>'.')and(fs.Name<>'..') then
if (fs.Attr and faDirectory)=faDirectory then
findall(disk,path+'/'+fs.Name,fileresult)
else
fileresult.add(disk+strpas(strupper(pchar(path)))+'/'+str
pas(strupper(pchar(fs.Name)))+'('+inttostr(fs.Size)+')');
end;
end;
findclose(fs);
end;