1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Function GetFolders&(ByVal sDir$, lst As ListBox) Dim s$, L& If Right$(sDir, 1 ) <> "\" Then sDir = sDir & "\" s = Dir$(sDir & "*", vbDirectory) L = 0 lst . Clear While s <> "" If s <> "." And s <> ".." Then lst . AddItem sDir & s L = L + 1 End If s = Dir$() Wend GetFolders = L End Function 'ИСПОЛЬЗОВАНИЕ N = GetFolders("c:\ 1 \", List1) ' List1 - ListBox, в котором будут имена папок ' N - сколько получилось папок |