|
-
Oct 8th, 2010, 10:25 PM
#4
Re: Not sure how to use this.
 Originally Posted by Mickroy
You can use the static GetFiles method of the Directory class & specify the last parameter as "SearchOption.AllDirectories". This will search recursively.
Code:
Dim myDirectories As String() = Directory.GetFiles("C:\", "*.*", SearchOption.AllDirectories)
That code will throw an exception when it inevitably encounters an inaccessible folder. If there's any chance of finding an inaccessible folder along the way then you must do the recursion yourself, so that you can handle the exception and continue.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|