Convert.FromBase64String
using System; using System.IO; using System.Text; class MainClass { public static void Main() { byte[] b = Encoding.Unicode.GetBytes("string"); // Return the Base64-encoded string. string str = Convert.ToBase64String(b); Console.WriteLine(str); Convert.FromBase64String(str); // Return the decoded Unicode string. Console.WriteLine(Encoding.Unicode.GetString(b)); } }