public static String EncryptBase64Code(String text)
{
Byte[] bufin = System.Text.ASCIIEncoding.UTF8.GetBytes(text);
String result = Convert.ToBase64String(bufin, 0, bufin.Length);
return result;
}
public static String DecryptBase64Code(String text)
{
try
{
Byte[] bufout = Convert.FromBase64String(text);
String result = System.Text.ASCIIEncoding.UTF8.GetString(bufout);
return result;
}
catch
{
return text;
}
}
{
Byte[] bufin = System.Text.ASCIIEncoding.UTF8.GetBytes(text);
String result = Convert.ToBase64String(bufin, 0, bufin.Length);
return result;
}
public static String DecryptBase64Code(String text)
{
try
{
Byte[] bufout = Convert.FromBase64String(text);
String result = System.Text.ASCIIEncoding.UTF8.GetString(bufout);
return result;
}
catch
{
return text;
}
}