File I/O Compatibility Between VB.NET Strings and C char's
Posted 27 April 2010 - 09:47 PM
I have recently started working in VB.NET. What I am trying to do is write a binary file from VB.NET that my C++ application can read. I have everything figured out except for getting the strings written. What I need to do is write a string to a binary file in VB.NET with a specified length of 32 characters long. It needs to be in ASCII encoding so that I can read it back in my C++ app into a char array. Does anyone know how to do this? I think I have to convert my VB.NET string to SBytes(32), and then write it with my binary reader object.
I have tried Asc() System.Text.Encoding.ASCII(), GetBytes encoding, etc... Any advise?
This post has been edited by travisTrue08: 27 April 2010 - 09:55 PM