① 导入命名空间:
1using System.Web.Security; ② 获取MD5码:
1string Password = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text.ToString(), "MD5"); 最后直接进行判断:
Code
1 public static bool Login(string UserName, string PassWord)
2 {
3 bool flag = false;
4
5 if (UserName == "admin" && PassWord == "E10ADC3949BA59ABBE56E057F20F883E")
6 {
7 flag = true;
8 }
9
10 return flag;
11 }
posted @
2009-09-07 10:24
王翔(kingfly)
阅读(
214)
评论()
编辑
收藏
举报