关于MD5的问题,再次开贴 我想把textbox1.text里面的值用md5加密,然后再跟textbox2.text比较大小,请问该如何去做呢?请把如何引入命名空间也写上谢谢了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 简单的使用头文件:using System.Web.Security;初始化数据库里的字段string strPwd=FormsAuthentication.HashPasswordForStoringInConfigFile(this.tbox_Pwd.Text,"MD5"); string outStr = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(inStr, "md5");//非Web项目,需要添加对System.Web的引用 System.Security.Cryptography.MD5CryptoServiceProvider _md5 = new MD5CryptoServiceProvider(); byte[] _t1 = _md5.ComputeHash(System.Text.Encoding.Default.GetBytes(this.textBox3.Text)); string _strT1 = BitConverter.ToString(_t1); byte[] _t2 = _md5.ComputeHash(System.Text.Encoding.Default.GetBytes(this.textBox4.Text)); string _strT2 = BitConverter.ToString(_t2); if(_strT1==_strT2) { MessageBox.Show("OK"); } else { MessageBox.Show("No"); } using System.Security.Cryptography;这个是Win下的 using System.Web.Security; string text1=FormsAuthentication.HashPasswordForStoringInConfigFile(this.Text1.Text.Trim(),"MD5");string text2 = this.Text2.Text.Trim();if(text1 == text2){ return true;}return false; c#中如何选项卡控件 c# datagridview 如何取消所有选中行 制作.net安装程序应该注意的问题 dataset Update的问题,SKS c#中如何實現發送郵件功能 C#程序不显示数据,江湖告急啊 如何向文本文件中快速插入文本?(急) c# winform窗体程序 登录后,主界面加载时间长 两个TEXTBOX之间的拖放问题!!!! 请高手指点? C# treeview key的问题 用程序怎样抓取浏览器 http get 请求的数据
//非Web项目,需要添加对System.Web的引用
byte[] _t1 = _md5.ComputeHash(System.Text.Encoding.Default.GetBytes(this.textBox3.Text));
string _strT1 = BitConverter.ToString(_t1);
byte[] _t2 = _md5.ComputeHash(System.Text.Encoding.Default.GetBytes(this.textBox4.Text));
string _strT2 = BitConverter.ToString(_t2);
if(_strT1==_strT2)
{
MessageBox.Show("OK");
}
else
{
MessageBox.Show("No");
}
这个是Win下的
string text1=FormsAuthentication.HashPasswordForStoringInConfigFile(this.Text1.Text.Trim(),"MD5");
string text2 = this.Text2.Text.Trim();
if(text1 == text2){
return true;
}
return false;