就是那种乱七八糟的字体。。
代码:public static string MD5Helper(string strPwd)
{
using(MD5CryptoServiceProvider md5 =new MD5CryptoServiceProvider())
{
Byte[] bytePwd = Encoding.Default.GetBytes(strPwd);
Byte[] hashPwd = md5.ComputeHash(bytePwd);
string encryptPwd = Encoding.Default.GetString(hashPwd);
return encryptPwd;
}
} private void button1_Click(object sender, System.EventArgs e)
{
string hashPwd = MD5Helper(this.textBox1.Text.ToString());
this.label2.Text=hashPwd;
}
代码:public static string MD5Helper(string strPwd)
{
using(MD5CryptoServiceProvider md5 =new MD5CryptoServiceProvider())
{
Byte[] bytePwd = Encoding.Default.GetBytes(strPwd);
Byte[] hashPwd = md5.ComputeHash(bytePwd);
string encryptPwd = Encoding.Default.GetString(hashPwd);
return encryptPwd;
}
} private void button1_Click(object sender, System.EventArgs e)
{
string hashPwd = MD5Helper(this.textBox1.Text.ToString());
this.label2.Text=hashPwd;
}
执行完这句后,hashPwd就应该是乱码
foreach(byte b in hashPwd)
{
encryptPwd += b.ToString("X");
}return encryptPwd;
using System.Security.Cryptography;
string hashPwd=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(textBox1.Text, "MD5");
用这个试试.