//인코딩
public static string Base64Encode(string text)
{
var textBytes = System.Text.Encoding.UTF8.GetBytes(text);
return System.Convert.ToBase64String(textBytes);
}
//디코딩
public static string Base64Decode(string base64)
{
var base64Bytes = System.Convert.FromBase64String(base64);
return System.Text.Encoding.UTF8.GetString(base64Bytes);
}
참조
https://www.dofactory.com/code-examples/csharp/encode-decode-base64-string