How to write data into a file?
-
Hi all, Can anybody please send me the code of how to write into a file. Thank you.
-
Hi all, Can anybody please send me the code of how to write into a file. Thank you.
-
Hi all, Can anybody please send me the code of how to write into a file. Thank you.
Lets say you wanna write data into binary file. Make sure you already convert the data into byte array (in this examples: StreamByte()). And if you;re using vb 2005, use this a line code to write to file. My.Computer.FileSystem.WriteAllBytes("C:\MyData.dat", StreamByte, True) Set the last argument to False if you want to append the file. It means, you can add more bytes chain into the same file. And if you wanna read your data, use this one Dim StreamByte As Byte() = My.Computer.FileSystem.ReadAllBytes("C:\MyData.dat") hope this helpful.