Here is a class for SD file operations written in VB. It is not production quality code by any means and there may be bugs (probably) and needs more error checking, but it should get you started. The last time I used this code was over two years ago. It was a first cut and needs more work. It runs on a Netduino Plus or Plus 2 running firmware 4.2.1
The code maintains a list of folders/files on the SD card with provision to create and delete folders and read/write/delete files.
Using SD As SDcard = New SDcard()
Dim flag as Boolean = SD.createDir("\SD\ABC")
Debug.Print( "Directory created successfully")
Debug.Print( "That directory already exists")
End Using 'SD card
Always use the full path as a string like this for addressing a file or folder,
"\SD\ABC" --> access or create folder ABC under the root, \SD\
"\SD\ABC\x" --> access or create a sub-folder x under ABC
To save text to a text file named, "My_textfile" in folder, x with content, "some content", using the saveTextFile method,
call: saveTextFile("some content","\SD\ABC\x\My_textfile").
There is an optional argument to saveTextFile, true or false. The default is false which overwrites an existing file. True appends to an existing file. Most of the file operations with the SD card are pretty much like regular Vb.NET.