示例#1
0
文件: UsersBL.cs 项目: slashgnr/CD
        public long GetUserid(string username, string password)
        {
            UsersDAL dal = new UsersDAL();
            bool isValid = false;
            long lId = 0;
            CD_Users user = dal.GetUser(username);

            if (user != null)
            {
                SaltedHash saltedHash = new SaltedHash();
                isValid = saltedHash.VerifyHashString(password, user.Password, user.Salt);
            }
            if (isValid)
            {
                lId = user.ID;
            }

            return lId;
        }
示例#2
0
文件: UsersBL.cs 项目: slashgnr/CD
        public bool ValidateUser(string username, string password)
        {
            UsersDAL dal = new UsersDAL();
            bool isValid = false;
            CD_Users user = dal.GetUser(username);

            if (user != null)
            {
                SaltedHash saltedHash = new SaltedHash();
                isValid = saltedHash.VerifyHashString(password, user.Password, user.Salt);
            }

            return isValid;
        }