May 29

Discuz!  密码加密方式! 不指定

之前做的.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);
  }
Add a comment

Nickname

Site URI

Email

Enable HTML Enable UBB Enable Emots Hidden Remember [Login] [Register]