本文整理自网络,侵删。
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 xe android/ios 实现图片放大缩小的两种方法
Delphi xe5 for android 调用java类库必看的文件
Delphi 注入不用writeprocessmemory 函数
Delphi urldownloadtofile 实现文件下载
更多相关阅读请进入《Delphi》频道 >>