converting array of byte to string in c#
C#
3
Posts
3
Posters
0
Views
1
Watching
-
Hi all, I am a Beginner to c#. I Need to convert array of byte data type to string. How to do this.. ex: byte[] bytes = new byte[1000]; this bytes get filled up. Now I need to convert to string. How to do this..
Hello You use the next code:
byte[] bytes = new byte[] { 0x41, 0x42, 0x43, 0x44, 0x45 }; string str = System.Text.Encoding.ASCII.GetString( bytes ); System.Diagnostics.Debug.WriteLine( str );
With best regards, Andrew Kirillov, MCP x 3 Prize winner, August 2005
-
Hello You use the next code:
byte[] bytes = new byte[] { 0x41, 0x42, 0x43, 0x44, 0x45 }; string str = System.Text.Encoding.ASCII.GetString( bytes ); System.Diagnostics.Debug.WriteLine( str );
With best regards, Andrew Kirillov, MCP x 3 Prize winner, August 2005