Here is a quick and simple way of reading/writing files.
Reading binary file.
Dim FileContent() as byte = my.computer.filesystem.readallbytes("MyFile.bin")
Reading text file.
Dim FileContent() as string = my.computer.filesystem.readalltext("MyFile.txt")
Writing binary file (Overwrite if exist)
Dim DataToBeWritten() as byte
My.computer.filesystem.writeallbytes("MyFile.bin", DataToBeWritten, false)
Writing binary file (Append if exist)
Dim DataToBeWritten() as byte
My.computer.filesystem.writeallbytes("MyFile.bin", DataToBeWritten, true)
Writing text file. (Overwrite if exist)
Dim DataToBeWritten as string
My.computer.filesystem.writealltext("MyFile.txt", DataToBeWritten, false)
Writing text file. (Append if exist)
Dim DataToBeWritten as string
My.computer.filesystem.writealltext("MyFile.txt", DataToBeWritten, true)