private string FromBase64String(string base64String)
{
if (string.IsNullOrWhiteSpace(base64String))
return base64String;
base64String.Replace('_', '/').Replace('-', '+');
switch (base64String.Length % 4)
{
case 2: base64String += "=="; break;
case 3: base64String += "="; break;
}
byte[] byteArray = Convert.FromBase64String(base64String);
return Encoding.Default.GetString(byteArray);
}