private void Password_One_Click(object sender, EventArgs e) { Password_One.SelectAll(); }
private void Password_One_TextChanged(object sender, EventArgs e) { try { if (Password_One.TextLength <= 0 || Password_One.Text == null) { Zxcvbn.Core.EvaluatePassword(AOORE); Password_One.Text = AOORE; Password_One.SelectAll(); } var Passwd_One = Zxcvbn.Core.EvaluatePassword(Password_One.Text); switch (Passwd_One.Score) { case 0: Result_one.Text = "Very Weak"; Result_one.ForeColor = Color.Red; Result_one.BackColor = Color.White; break; case 1: Result_one.Text = "Weak"; Result_one.ForeColor = Color.Orange; Result_one.BackColor = Color.White; break; case 2: Result_one.Text = "Good"; Result_one.ForeColor = Color.Yellow; Result_one.BackColor = Color.DarkKhaki; break; case 3: Result_one.Text = "Strong"; Result_one.ForeColor = Color.Blue; Result_one.BackColor = Color.White; break; case 4: Result_one.Text = "Very Strong"; Result_one.ForeColor = Color.Green; Result_one.BackColor = Color.White; break; } Guesses_one.Text = "Guesses: " + Passwd_One.Guesses.ToString(); Warning_one.Text = "Warning: " + Passwd_One.Feedback.Warning; Suggestion_one.Text = "Suggestions: " + Passwd_One.Feedback.Suggestions[0]; Crack_Time_one.Text = "Crack Time: " + Passwd_One.CrackTimeDisplay.OnlineNoThrottling10PerSecond; Compare_Passwd(); } finally { if (Password_One.TextLength <= 0 || Password_One.Text == null) { Zxcvbn.Core.EvaluatePassword(AOORE); Password_One.Text = AOORE; Password_One.SelectAll(); } } }