I have the code to do that, and it worked on one of the hard drives I'm organizing files from, but the other two contain secured folders and files, and I get an exception when I try and get access to them, and my program justs stops and won't continue.
I'm using something like the following
Expand|Select|Wrap|Line Numbers
- public System.Collections.Generic.List<string> GetFiles(string StartingDirectory)
- {
- System.Collections.Generic.List<string> Extensions = new System.Collections.Generic.List<string>();
- Extensions.Add("mp3");
- //More Extensions
- System.Collections.Generic.List<string> Files = new System.Collections.Generic.List<string>();
- foreach (string Extension in Extensions)
- {
- foreach (string File in System.IO.Directory.GetFiles(StartingDirectory, "*." + Extension, System.IO.SearchOption.AllDirectories)) Files.Add(File);
- }
- return Files;
- }