Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic Classic (6 and earlier)
Expertise: Beginner
Dec 17, 2009



Building the Right Environment to Support AI, Machine Learning and Deep Learning

A Simple Password-Checking Routine

Developed for a password-reset program, this routine ensures that the user-entered password matches specific password criteria. In this example, the password had to be between 8 and 12 characters long and contain at least one upper case, one lower case, and one numeric character. The order of these didn't matter, as long as there was one of each.

After doing some testing, I settled on the LIKE operator, which (unlike popular assumptions) isn't just for database matches.

If (Text1 Like "*[A-Z]*") And _
   (Text1 Like "*[a-z]*") And _
   (Text1 Like "*[0-9]*") And _
   (Len(Text1) > 7 And Len(Text1) < 13) Then
   MsgBox "Password has correct usage."
   MsgBox "Password must be between 8 and 12 characters, " & _
   "with one upper case letter, a lower case letter, and one number."
End If
Brian Abernathy
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date