byte64 to string c# code example
Example 1: convert system.byte a string c#
string result = System.Text.Encoding.UTF8.GetString(byteArray);
Example 2: convert base64 string to string c#
byte[] data = Convert.FromBase64String(encodedString);
string decodedString = Encoding.UTF8.GetString(data);
Example 3: c# string to byte[]
using System.Text;
public static byte[] encode(string stringToEncode)
{
UTF8Encoding utf8 = new UtF8Encoding();
byte[] bytename = new byte[1024];
bytename = utf8.GetBytes(stringToEncode);
return bytename;
}