/// <summary>
/// 使用MD5算法加密(不可逆,无法解密)
///
把此方法加入CS页面然后直接调用就行了
/// </summary>
/// <param
name="password">明文</param>
///
<returns>密文</returns>
public static string
EncryptionMD51(string password)
{
System.Security.Cryptography.MD5 md5 =
System.Security.Cryptography.MD5.Create();
byte[] bytes = new
byte[16];
System.Text.ASCIIEncoding asc = new
System.Text.ASCIIEncoding();
bytes =
md5.ComputeHash(asc.GetBytes(password));
return
Convert.ToBase64String(bytes);
}
原文:http://www.cnblogs.com/karlzhao/p/3663132.html