Hello, first post here :) I'm new to VB, and I started it for an A-level at my school. I'm learning about IF statements and I'm doing a simple password strength program to find it. The ending of what i have is:
I want to add an Application.Restart if the code isn't strong, which also resets all the variables I used before. However, when I try to add Application.Restart, it doesn't exist. I'm using Visual Studio Express 2012 if that helps. Thanks!
Code:
If TotalStrength = 1 Then
Console.WriteLine("Your password is WEAK!")
If Numeric = False Then
Console.WriteLine("Your password must contain at least one number!")
End If
If UpperCase = False Then
Console.WriteLine("Your password must contain at least one upper case character!")
End If
If LowerCase = False Then
Console.WriteLine("Your password must contain at least one lower case character!")
End If
ElseIf TotalStrength = 2 Then
Console.WriteLine("Your password is MEDIUM!")
If Numeric = False Then
Console.WriteLine("Your password must contain at least one number!")
End If
If UpperCase = False Then
Console.WriteLine("Your password must contain at least one upper case character!")
End If
If LowerCase = False Then
Console.WriteLine("Your password must contain at least one lower case character!")
End If
ElseIf TotalStrength = 3 Then
Console.WriteLine("Password is strong.")
ElseIf TotalStrength = 0 Then
Console.WriteLine("Error: Strength too low")
Else
Console.WriteLine("Error")
End If
Else
'Password Length is not good
Console.WriteLine("Your password must be between 6 and 12 characters long!")
End If
End Sub
End Module