public string Md5p(string strPassword)
{
MD5CryptoServiceProvider hashmd5;
hashmd5 = new MD5CryptoServiceProvider();
return BitConverter.ToString(hashmd5.ComputeHash(Encoding.Default.GetBytes(strPassword))).Replace("-", "").ToLower();
}
//加密了
public string Encryptyiersan(string inp)
{
MD5CryptoServiceProvider hasher = new MD5CryptoServiceProvider();
byte[] tBytes = Encoding.ASCII.GetBytes(inp);
byte[] hBytes = hasher.ComputeHash(tBytes);
StringBuilder sb = new StringBuilder();
for (int c = 0; c < hBytes.Length; c++)
sb.AppendFormat("{0:x2}", hBytes[c]);
return (sb.ToString());
}
//解密的时候直接在把文本框的值赋给加密的方法就行了