How to retrieve every subfolders and files of a specified directory ?

Hi everyone,

I would like to import every subfolders and files of a designated folder,


Code samples I tried so far, only shows first sublevel and do not go further (not the full tree),
which can also be obtained by using
Directory.GetFileSystemEntries().

 

Anyone knows a good method on how to import every files and subfolders, and store them into an array 

 

Thanks a lot

 

 



Answer this question

How to retrieve every subfolders and files of a specified directory ?

  • alan279

    try this...

    Dim theFolders() as String = System.IO.Directory.GetDirectories(path, "*", SearchOption.AllDirectories)

    Dim theFiles() as String = System.IO.Directory.GetFiles(path, "*", SearchOption.AllDirectories)



  • Chris Richner

    That's perfect

    Thanks !

  • How to retrieve every subfolders and files of a specified directory ?