.NET中获取字符串的MD5码

① 导入命名空间: 

 using System.Web.Security;

提示:不存在Security,缺少程序集引用,那么为此类添加引用:System.Web即可;

② 获取MD5码:

string Password = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text.ToString(), "MD5");

posted @ 2014-12-19 12:02  苏剑波  阅读(118)  评论(0)    收藏  举报