byte[] result =
Encoding.Default.GetBytes(this.tbPass.Text.Trim());
//tbPass为输入密码的文本框
MD5 md5 = new
MD5CryptoServiceProvider();
byte[] output =
md5.ComputeHash(result);
this.tbMd5pass.Text =
BitConverter.ToString(output).Replace("-","");
原文地址:http://www.cnblogs.com/liyangLife/p/3770496.html