本文整理自网络,侵删。
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 如何让程序在按了 android 的 back 键后不关闭当前 from 或者不 app 退出
Delphi xe 获取 android application version 版本
Delphi运行时的问题,cannot focus a disabled or invisible window!
Delphi xe5 android 使用system.zip单元释放资源文件
更多相关阅读请进入《Delphi》频道 >>