File I/O Compatibility Between VB.NET Strings and C char[]'s

Converting a VB.NET string to an ASCII string with a specified length

Page 1 of 1

0 Replies - 850 Views - Last Post: 27 April 2010 - 09:47 PM Rate Topic: -----

#1 travisTrue08  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-April 10

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[32] 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


Is This A Good Question/Topic? 0
  • +

Page 1 of 1