Discuz!  密码加密方式!

[2010/05/29 02:19 | 分类: .NET/C#/VS | by actimind ]
之前做的.net程序使用 Discuz!  会员表的数据,修改密码后不能登陆,原来是加密码方式变了。

C#的写法:

  strSql = "select username,password,uid,salt from `cdb_uc_members` where  username ='" + userName + "' ";
  string salt = rs.GetValue(3) == null ? "" : rs.GetValue(3).ToString();
  string readPassword = rs.GetString(1);              
  string codePassword = "";
   if (salt != null && salt.Length > 0)
  {
       codePassword = Functions.MD5(Functions.MD5(passWord, 32)+salt , 32);                    
  }
   else
  {
        codePassword = Functions.MD5(passWord, 32);
  }
Comments(0) | Trackbacks(0) | Reads(886)
Add a comment
Nickname [Register]
Password Optional
Site URI
Email
Enable HTML Enable UBB Enable Emots Hidden Remember