ASP.NET中对字符串加密

来源:互联网 发布:美国人工智能机器人 编辑:程序博客网 时间:2024/06/05 20:50

//使用前添加此引用

using System.Web.Security;

//41位SHA1加密

SHA1.Text = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text,"SHA1");

//32位MD5加密

MD5.Text =FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "MD5") ;

原创粉丝点击