本文整理自网络,侵删。
推荐这个:http://www.delphitop.com/html/wenjian/3694.html
Procedure ListFolders(const DirName: string; FolderList : Tstrings);var Path: string; F: TSearchRec; SubDirName: string;
begin Path:= DirName + '\*.*'; Application.ProcessMessages; if FindFirst(Path, faAnyFile, F) = 0 then begin try repeat if (F.Attr and faDirectory <> 0) then begin if (F.Name <> '.') and (F.Name <> '..') then begin SubDirName:= IncludeTrailingPathDelimiter(DirName) + F.Name; FolderList.Add(SubdirName); ListFolders(SubDirName,FolderList); end; end; until FindNext(F) <> 0; finally FindClose(F); end; end;end;
相关阅读 >>
Delphi superobject json操作类的基本用法
Delphi application.processmessage作用
Delphi xe安装 tclientsocket, tserversocket控件
Delphi datamodule1 fdconnection1数据库连接
更多相关阅读请进入《Delphi》频道 >>