I seem unable to get my SD card reading using VB or C# with the 4.2 firmware on a Netuino Plus. I have tried a variety of cards all 2 GIG and formatted in FAT 16 or 32. Nothing seem to work. Here is the code i used it is a c# conversion to vb from an example on the forums here. I have also compiled the original example in c# and that gives the same error
Firstly the call to "GetDirectories" returns no directories and then the call to "GetFiles("\SD")" causes the following error
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
Dim directories As String() = System.IO.Directory.GetDirectories("\") Debug.Print("directory count: " + directories.Length.ToString()) For i As Integer = 0 To directories.Length - 1 Debug.Print("directory: " + directories(i)) Next Dim files As String() = System.IO.Directory.GetFiles("\SD") Debug.Print("file count: " + files.Length.ToString()) For i As Integer = 0 To files.Length - 1 Debug.Print("filename: " + files(i)) Dim fs As New FileStream(files(i), FileMode.Open, FileAccess.Read, FileShare.None, 512) Dim sr As New StreamReader(fs) Debug.Print("contents: " + sr.ReadToEnd()) Next
Am I just being plain stupid or is there a problem, if it is the former then can someone please correct my errors and post me a solution.
Cheers Pete