I have a new program I am writing in C#, it will need to read and write binary files that are compatible with vb6\'s binary format. I can not change the vb6 program but I ca
It is simply a short that contains the string length, use BinaryWriter(short). Don't use BinaryWriter.Write(string), use BinaryWriter.Write(byte[]) where you got the byte[] from Encoding.Default.GetBytes().
Intentional avoiding the compat functions in the Microsoft.VisualBasic namespace might not the be most productive approach. It doesn't byte, the framework doesn't care what language you use. Have a look at Microsoft.VisualBasic.FileSystem.FilePut(). Available in any .NET framework version, that's code you won't have to maintain and has been tested by thousands. You do have to add an assembly reference to Microsoft.VisualBasic.