本文标签: Delphi专栏 , Wince/WindowsMobile专栏
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;
声明: 本文由( 张飞不张,文采横飞 )原创编译,转载请保留链接: 最简单的查找文件的代码
Linux系统与内核学习群:194051772
WP建站技术学习交流群:194062106