Easiar way of Password checking in code

Posted by vishalneeraj-24503 under VB.NET category on | Points: 40 | Views : 411
In below code,the password must be between 4 to 10 characters long and contain at least one upper case,one lower case,and one numeric character.We will use Like operator for password checking.

If(txt_user_pwd Like "*[A-Z]*") And (txt_user_pwd Like "*[a-z]*") And (txt_user_pwd Like "*[0-9]*") And _
(Len(txt_user_pwd) > 3 And Len(txt_user_pwd) < 11) Then
'do your code
MsgBox "Password must be between 4 and 10 characters, " & _
"with one upper case letter,a lower case letter,and one number."
End If

Comments or Responses

Login to post response