procedure GetSubDirs(Folder: string; sList: TStrings);
var
sr: TSearchRec;
begin
if FindFirst(Folder + '*.*', faDirectory, sr) = 0 then //把faDirectory 改成faAnyFile可以列出隐藏及系统文件夹
try
repeat
if (sr.Attr and faDirectory) = faDirectory then
sList.Add (sr.Name);
until FindNext(sr) <> 0;
finally
FindClose(sr);
end;
end;
GetSubDirs('E:/123/', ListBox1.Items);