// 将字符串转换为Base64编码
Byte[] buf = System.Text.ASCIIEncoding.UTF8.GetBytes(sourceString);
String resultString = Convert.ToBase64String(buf, 0, buf.Length);
// 从Base64编码转换回一般字符串
Byte[] bufout = Convert.FromBase64String(EncryptedString);
String resultString = System.Text.ASCIIEncoding.UTF8.GetString(bufout);
没有评论:
发表评论