byte[] to string

  • Thread starter Thread starter Fernando Lopes
  • Start date Start date
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
 
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
 
Back
Top