Exemplo n.º 1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }
            string           pass     = (string)value;
            PasswordStrength strength = PasswordStrengthUtils.CalculatePasswordStrength(pass);

            return(strength.ToString());
        }
Exemplo n.º 2
0
        private void passwordTxt_TextChanged(object sender, EventArgs e)
        {
            var passGen = new PasswordGenerator();

            strength = passGen.DetermineStrength(passwordTxt.Text.ToString());
            passwordStrengthLbl.Text = "Password Strength: " + strength.ToString(); //dynamically update the strength of the password

            if (retypedPassTxt.Text != "")
            {
                passwordsMatchTxt.Text = passwordTxt.Text == retypedPassTxt.Text ? "Passwords match" : "Passwords do not match";
            }
        }