Crdown's学习笔记

ASP.NET,Report...

博客园 首页 新随笔 联系 订阅 管理

string str = TextBox1.Text.Trim();
string str2 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");

Label1.Text = str2;

 

上例是转换为32位的方法

 

string str = TextBox1.Text.Trim();
string str2 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower.Substring(8, 16);
Label1.Text = str2;

 

上例是转换为16位小写的方法,其实是取了32位的9-25字符

posted on 2010-03-15 17:50  Crdown  阅读(259)  评论(0编辑  收藏  举报