BlogEngine.Core.Providers.XmlMembershipProvider.ValidateUser C# (CSharp) Method

ValidateUser() public method

Returns true if the username and password match an exsisting user.
public ValidateUser ( string username, string password ) : bool
username string /// The username. ///
password string /// The password. ///
return bool
        public override bool ValidateUser(string username, string password)
        {
            var validated = false;
            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                return false;
            }

            try
            {
                this.ReadMembershipDataStore();

                // Validate the user name and password
                MembershipUser user;
                if (this.users[Blog.CurrentInstance.Id].TryGetValue(username, out user))
                {
                    validated = this.CheckPassword(user.Comment, password);
                }

                return validated;
            }
            catch (Exception)
            {
                return validated;
            }
        }