vb.net中的密码验证 [英] password validation in vb.net
本文介绍了vb.net中的密码验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在vb.net中验证密码(具有至少1个字符,1个数字和1个特殊字符的强密码)
how to validate the password (strong password having atleast 1 charecter 1 number and 1 special charecter) in vb.net
推荐答案
最简单的方法是使用使用正则表达式检查输入的密码是否有效.表达式((?=.*\\d)(?=.*[A-Za-z])(?=.*[@#
The easiest way is to use a regular expression to check if the entered password is valid. The expression ((?=.*\\d)(?=.*[A-Za-z])(?=.*[@#
%]))将检查输入的密码是否至少包含1个数字(?=.*\\d)
,1个字母(大写或小写(?=.*[A-Za-z])
和列表(?=.*[@#
%])) will check if the entered password contains at least 1 number(?=.*\\d)
, 1 letter(either upper or lower case(?=.*[A-Za-z])
and 1 character in the list(?=.*[@#
%])中的1个字符).
%]).
这篇关于vb.net中的密码验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文