BASE 64
Encode
public static string Base64Encode(string
plainText) {
string myRes = "";
try
{
var base64EncodedBytes =
System.Convert.FromBase64String(base64EncodedData);
myRes =
System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
}
catch
{
myRes = base64EncodedData;
}
return myRes;
}
Decode
public static string Base64Decode(string
base64EncodedData) {
string myRes = "";
try
{
var plainTextBytes =
System.Text.Encoding.UTF8.GetBytes(plainText);
myRes =
System.Convert.ToBase64String(plainTextBytes);
}
catch
{
myRes = plainText;
}
return myRes;
}