Hi everyone,
I've seen this code (and similar) all over the web, but I just cannot get it to work. Whenever I debug it line by line, it breaks out of debugging and loads the application. No error messages are presented, and any code after the "faulty" line remains unprocessed.
Here is the offending code:
foreach (string folder in allFolders)
{
string[] subFolders = Directory.GetDirectories(folder,
"*", SearchOption.AllDirectories);
MessageBox.Show("Test");
}
The foreach loop is entered into, but the message box is never displayed.
If I remove the SearchOption.AllDirectories
the code is processed successfully, but I need some way to include all subdirectories within the directories.
Any ideas?