"Andrea" <andreno_spamalmieri@enmo_spamm> wrote in message
news:e9*************@TK2MSFTNGP09.phx.gbl...
how can I convert a byte[] to a string ?
Any idea?
Andrea
How are the characters encoded in the byte array? You need to examine the
System.Text.Encoding class and its related classes:
System.Text.ASCIIEncoding, System.Text.UnicodeEncoding. Here's a basic
example, if the byte array is ASCII:
System.Text.ASCIIEncoding AE = new System.Text.ASCIIEncoding();
byte[] ByteArray = { 69, 110, 99, 111, 100, 105, 110, 103, 32, 83, 116,
114, 105, 110, 103, 46 };
char[] CharArray = AE.GetChars(ByteArray);
string s = new string(CharArray);
MessageBox.Show(s);
Erik