System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding();
byte[] byteArray = encoding.GetBytes("your string");
The opposite conversion (byte array to string) looks like this:
System.Text.UnicodeEncoding enc = new System.Text.UnicodeEncoding();
string myString = enc.GetString(byteArray);
No comments:
Post a Comment