Convert System.Byte[] to System.String

I

Imran Aziz

Hello All,
How can I convert System.Byte[] to System.String ?
When I use Convert.ToString() it just returns me the string "System.Byte[]"
Please help me out with this.

Imran.
 
S

S. Justin Gengo

Imran,

String MyString;
System.Text.ASCIIEncoding ASCIIEncoding = New System.Text.ASCIIEncoding;
MyString = ASCIIEncoding.GetString(Bytes);

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
J

Joerg Jooss

S. Justin Gengo said:
Imran,

String MyString;
System.Text.ASCIIEncoding ASCIIEncoding = New
System.Text.ASCIIEncoding; MyString = ASCIIEncoding.GetString(Bytes);

Note that this is a sample, not a solution. You have to use the correct
encoding, not simply ASCII.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top