Decode a Base64-encoded Unicode string from a string
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));
}
}