Convert from string to byte array:
string strToConvert = "This text need to converted to byte array";
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
byte[] bArray = encoding.GetBytes(strToConvert);
Convert from byte array to string:
string strToConvert = "This text need to converted to byte array";
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
byte[] bArray = encoding.GetBytes(strToConvert);System.Text.UTF8Encoding enco =new System.Text.UTF8Encoding();
string strConvertedString = enco.GetString(bArray);
string strToConvert = "This text need to converted to byte array";
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
byte[] bArray = encoding.GetBytes(strToConvert);
Convert from byte array to string:
string strToConvert = "This text need to converted to byte array";
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
byte[] bArray = encoding.GetBytes(strToConvert);System.Text.UTF8Encoding enco =new System.Text.UTF8Encoding();
string strConvertedString = enco.GetString(bArray);
No comments:
Post a Comment