Example #1
0
 private void Password_Two_Click(object sender, EventArgs e)
 {
     Password_two.SelectAll();
 }
Example #2
0
        private void Password_two_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (Password_two.TextLength <= 0 || Password_two.Text == null)
                {
                    Zxcvbn.Core.EvaluatePassword(AOORE);
                    Password_two.Text = AOORE;
                    Password_two.SelectAll();
                }

                var Passwd_two = Zxcvbn.Core.EvaluatePassword(Password_two.Text);

                switch (Passwd_two.Score)
                {
                case 0:
                    Result_two.Text      = "Very Weak";
                    Result_two.ForeColor = Color.Red;
                    Result_two.BackColor = Color.White;
                    break;

                case 1:
                    Result_two.Text      = "Weak";
                    Result_two.ForeColor = Color.Orange;
                    Result_two.BackColor = Color.White;
                    break;

                case 2:
                    Result_two.Text      = "Good";
                    Result_two.ForeColor = Color.Yellow;
                    Result_two.BackColor = Color.DarkKhaki;
                    break;

                case 3:
                    Result_two.Text      = "Strong";
                    Result_two.ForeColor = Color.Blue;
                    Result_two.BackColor = Color.White;
                    break;

                case 4:
                    Result_two.Text      = "Very Strong";
                    Result_two.ForeColor = Color.Green;
                    Result_two.BackColor = Color.White;
                    break;
                }

                Guesses_two.Text    = "Guesses: " + Passwd_two.Guesses.ToString();
                Warning_two.Text    = "Warning: " + Passwd_two.Feedback.Warning;
                Suggestion_two.Text = "Suggestions: " + Passwd_two.Feedback.Suggestions[0];
                Crack_Time_two.Text = "Crack Time: " + Passwd_two.CrackTimeDisplay.OnlineNoThrottling10PerSecond;
                Compare_Passwd();
            }
            finally
            {
                if (Password_two.TextLength <= 0 || Password_two.Text == null)
                {
                    Zxcvbn.Core.EvaluatePassword(AOORE);
                    Password_two.Text = AOORE;
                    Password_two.SelectAll();
                }
            }
        }