如何加强注册页面的密码以及如何在asp.net C#中进行验证 [英] How to strenghten the password for a registration page and how to validate it in asp.net c#
本文介绍了如何加强注册页面的密码以及如何在asp.net C#中进行验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何加强注册页面的密码以及如何在asp.net c#中验证密码
我想要一些字符,数字,特殊字符,
How to strenghten the password for a registration page and how to validate it in asp.net c#
I want some characters,numbers,Special characters,
<td style="text-align: left; width: 90px;">
Password
</td>
<td style="font-family: Verdana; font-size: medium; font-style: normal; text-align: left">
<asp:TextBox ID="txtpassword" runat="server" Width="208px" ></asp:TextBox>
<asp:RegularExpressionValidator ID="regpass" runat="server"
ErrorMessage="RegularExpressionValidator" ControlToValidate="txtpassword"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
推荐答案
使用
验证密码 -必须为8个字符,包括1个大写字母,1个特殊字符&字母数字字符
Validating password with
-must be 8 characters including 1 uppercase letter, 1 special character & alphanumeric characters
(?=.*\d) # must contain at least one digit
(?=.*[A-Z]) # must contain at least one uppercase character
(?=.*\W) # must contain at least one special symbol
. # match anything with previous condition checking
{8,8} # length at least 8 characters and also maximum of 8
一行:
In one line:
((?=.*\d)(?=.*[A-Z])(?=.*\W).{8,8})
资料来源:
* 密码匹配表达式 [使用正则表达式的密码强度验证 [ ^ ]
* ASP.Net正则表达式验证器以验证最小和最大文本长度 [
Sources:
* Password matching expression[^]
* Password Strength Validation with Regular Expressions[^]
* ASP.Net Regular Expression Validator to validate Minimum and Maximum Text Length[^]
这篇关于如何加强注册页面的密码以及如何在asp.net C#中进行验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文