Need Help Please
I want to create a password textbox that would tell if my password that I input is strong, good or weak
It will tell that my password is strong if it includes numbers, letters and special characters
good if it has letters and numbers
and if it has only letters or numbers it will be classified as weak
Here's the code I used:::
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged Dim t As String = TextBox1.Text Dim upper As Integer Dim lower As Integer Dim numbers As Integer Dim other As Integer For i = 0 To t.Length - 1 If Char.IsLetter(t(i)) Then If Char.IsUpper(t(i)) Then upper += 1 Label1.Text = "Strong" Else lower += 1 Label1.Text = "Weak" End If ElseIf Char.IsNumber(t(i)) Then numbers += 1 Label1.Text = "Medium" Else other += 1 Label1.Text = "Weak" End If Next Dim iSetTotal As Integer = upper + lower + numbers + other '// sum Total. If iSetTotal <= 5 Then Label1.BackColor = Color.Red '// if Less than 6. If iSetTotal > 5 AndAlso iSetTotal <= 10 Then Label1.BackColor = Color.Orange '// if Greater than 5 and less that 11. If iSetTotal > 10 Then Label1.BackColor = Color.Green '// if Greater than 10. End Sub
- But, it seems like it only tells if my password is strong or not depending on the length of the characters
What if i put in the password is "8Aa9$" and i want it to be viewed as a strong password ?
What should i Do ?
What should I Change in the code ?