ChiakiYu.Common.Data.UserPasswordHelper.CheckPassword C# (CSharp) Method

CheckPassword() public static method

检查用户密码是否正确
public static CheckPassword ( string password, string storedPassword, UserPasswordFormat passwordFormat ) : bool
password string 用户录入的用户密码(尚未加密的密码)
storedPassword string 数据库存储的密码(即加密过的密码)
passwordFormat UserPasswordFormat 用户密码存储格式
return bool
        public static bool CheckPassword(string password, string storedPassword, UserPasswordFormat passwordFormat)
        {
            var encodedPassword = EncodePassword(password, passwordFormat);

            return encodedPassword != null &&
                   encodedPassword.Equals(storedPassword, StringComparison.CurrentCultureIgnoreCase);
        }