C#中用MD5實現數據加密
using System.Security.Cryptography;
using System.Text;
private void button1_Click(object sender, System.EventArgs e)
{
byte[] bt=UTF8Encoding.UTF8.GetBytes(textBox1.Text );//UTF8需要對Text的引用
MD5CryptoServiceProvider objMD5;
objMD5=new MD5CryptoServiceProvider ();
byte[] output=objMD5.ComputeHash (bt);
textBox2.Text =BitConverter.ToString (output);
}
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/