delphi FileSearch 获取指定文件夹下所有文件包括隐藏文件


本文整理自网络,侵删。

 
 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 锁定系统解锁系统

Delphi xe5 重启 关闭 windows 8

Delphi 32位程序 out of memory 内存不足时解决办法之一

Delphi append 追加内容到文件中

Delphi 有关debughook

Delphi 判断表字段是否存在

Delphi controlcount和componentcount的区别

Delphi form生成时的事件次序

Delphi�⒆执�传入到windows目前窗口cursor所在位置

Delphi字符串旋转任意角度

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...