在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
///<summary>遍历文件</summary> ///<param>AList: 遍历所得文件列表,全路径</param> ///<param>APath: 遍历目录</param> ///<param>AExt: 遍历文件扩展名</param> procedure gFileList(AList: TStringList; const APath, AExt: String); var str: String; sch:TSearchrec; begin if AList = nil then Exit; AList.Clear; str := Trim(APath); if RightStr(str, 1) <> '\' then str := str + '\'; if not DirectoryExists(str) then Exit; if SysUtils.FindFirst(str + '*', faAnyfile, sch) = 0 then begin repeat Application.ProcessMessages; if ((sch.Name = '.') or (sch.Name = '..')) then Continue; if DirectoryExists(str + sch.Name) then gFileList(AList, str + sch.Name, AExt) else begin if (UpperCase(ExtractFileExt(str + sch.Name)) = UpperCase(AExt)) or (AExt='.*') then AList.Add(str + sch.Name); end; until FindNext(sch) <> 0; SysUtils.FindClose(sch); end; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论