I want to find all the folders inside a folder


#1

Is there any way to get all the folder names inside a folder?


#2

please refer above link.


#3

Hi,
Assign strArray(system.string[])= Directory.GetDirectories(“Folder Path”)
Use For each loop to itirate through all the folder.


#4

Use Directory.GetDirectory(“path”)

foldername

folder_name(Variable type is in array of String)

Output


How to loop through each files in a folder and perform an activity in each file
#5

hi Poovarasan 2 ,
I need only display folder names inside the folder … your output shows absolute path … i need only display relative paths only… can you help me

thanks in advance,


#6

Please use same code as suggested by @Poovarasan2 and pass out put variable into a Messagebox


#7

hi ajith,
Use Path.GetFileName(“string name”) in your for each loop like this…

name


#8

hi i hope this will help you …i am sure