byte[] to string

F

Fernando Lopes

Hi ALL.
Someone knows how can I convert a byte[] field to a string field?
The problem is, I'm uploading a xml file and I'm requesting the file using
Request.BinaryRead();

So, now I need to convert the result of Request.BinaryRead() method to a
string variable.

Thanks in advance.

FernandoLopes
 
D

DalePres

If you're going to be transporting your string over the web you should
probably convert your bytes to a Base64 string using
Convert.ToBase64String(byte []) and then get the bytes back on the other end
using Conver.FromBase64String(string).

HTH

DalePres
 

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

Top