Tuesday, October 25, 2016

Convert a String to a Byte Array in C#


public static byte[] StrToByteArray(string str)
{
   System.Text.UTF8Encoding  encoding=new System.Text.UTF8Encoding();
   return encoding.GetBytes(str);
}

No comments:
Write comments
Recommended Posts × +