Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have directory named leftpanel in my vb project
i want to open leftpanel directory and read names of folders in it and read images in each folder

i use
Dim Dirs() As String = Directory.GetDirectories(StartPath)
        DirectoryList.AddRange(Dirs)

        For Each Dir As String In Dirs
            GetDirectories(Dir, DirectoryList)
        Next

but i want to get StartPath (path of leftpanel folder)
Posted
Comments
Sergey Alexandrovich Kryukov 4-Jul-14 11:49am    
"Directory named leftpanel"? Aren't you mixing up directories (file system objects) and controls, UI?
—SA
Sergey Alexandrovich Kryukov 4-Jul-14 12:15pm    
One unrelated thing: please stop posting non-solutions as "answers"; this is considered as abuse.
Instead use comments and/or "Improve question".
—SA

1 solution

Try:
VB
Dim files() As String = Directory.GetFiles(dir)
Or use the overload that lets you specify a "search pattern" to limit it to (say) .JPG files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900