chris

chris

  • NA
  • 20
  • 0

Help reading string

Jan 8 2009 3:28 PM
Ok, so I have a file. I want to read some strings. In binary data I believe the most efficient way would be by using this code in order to make it quickly:

// ASCII
byte[] xDataBytes = xBR.ReadBytes(xCount);
string xDataString = ASCIIEncoding.ASCII.GetString(xDataBytes);

/* Unicode, xCount being the count of bytes from the
First letter to the last possible letter */
xDataBytes = xBR.ReadBytes(xCount);
xDataString = UnicodeEncoding.Unicode.GetString(xDataBytes);

Now, in the picture below is what I want to binarily read into my file's textBox1.Text

http://i39.tinypic.com/2e0kydy.jpg

It would need to search for example (<--space) then read TEST into the textbox 1.

If someone could help me out with code I would appreciate it.

Answers (1)