My N+2 SD Card is strange. Follow code with remarks
public class Program
{
public static void Main()
{
Thread.Sleep(1000);
DirectoryInfo rootDirectory = new DirectoryInfo(@"SD");
RecurseFolders(rootDirectory);
while (true) ;
}
private static void RecurseFolders(DirectoryInfo directory)
{
bool DE = directory.Exists; [color=#ff0000;]// >>> A first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll[/color]
if (true) [color=#ff0000;]// >>> to force this block, because DE returns false, but...[/color]
{
Debug.Print(directory.FullName); [color=#ff0000;]// >>> ... this line returns SD[/color]
Thread.Sleep(10);
foreach (FileInfo file in directory.GetFiles()) [color=#ff0000;]// >>> A first chance exception of type 'System.IO.IOException' occurred in Microsoft.SPOT.IO.dll
// >>> A first chance exception of type 'System.IO.IOException' occurred in System.IO.dll
// >>> An unhandled exception of type 'System.IO.IOException' occurred in System.IO.dll[/color]
{
Debug.Print(file.FullName); // >>> the debugger stops before this line
}
foreach (DirectoryInfo subDirectory in directory.GetDirectories())
{
RecurseFolders(subDirectory);
}
}
else
{
Debug.Print("No such Directory !");
}
}
}