-
March 24th, 2010, 09:24 PM
#1
filestream reads bytes - how to read chars?
I have successfully gotten the filestream function to read a text file and return bytes. I want it to return letters, not bytes, using random access.
Any suggestions?
-
March 24th, 2010, 09:58 PM
#2
Re: filestream reads bytes - how to read chars?
-
March 24th, 2010, 10:55 PM
#3
Re: filestream reads bytes - how to read chars?
If you have the data in a byte array after using your read function you can convert it to a string by using something like
Code:
MyString=System.Text.Encoding.ASCII.GetString(rBytes, 0, bReceived)
Where rBytes is the byte array which holds the data and bReceived is the number of bytes
-
March 25th, 2010, 01:42 AM
#4
Re: filestream reads bytes - how to read chars?
-
March 25th, 2010, 02:00 AM
#5
Re: filestream reads bytes - how to read chars?
Glad you got it solved!
Please mark your thread as resolved as explained here :
http://www.codeguru.com/forum/showthread.php?t=403073
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|