本文整理自网络,侵删。
procedure FileSearch(const PathName, FileName : string) ; var Rec : TSearchRec; Path : string; begin Path := IncludeTrailingPathDelimiter(PathName) ; if FindFirst (Path + FileName, faAnyFile - faDirectory, Rec) = 0 then try repeat ListBox1.Items.Add(Path + Rec.Name) ; until FindNext(Rec) <> 0; finally FindClose(Rec) ; end;{
用法:FileSearch('C:\Users\Desktop\_recovery','*.ini'); 获取指定扩展名文件
用法:FileSearch('C:\Users\Desktop\_recovery','*.*'); 获取所有文件
}
end;
相关阅读 >>
Delphi 32位程序 out of memory 内存不足时解决办法之一
Delphi controlcount和componentcount的区别
Delphi�⒆执�传入到windows目前窗口cursor所在位置
更多相关阅读请进入《Delphi》频道 >>