密码验证 [英] Pass word validation

查看:85
本文介绍了密码验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的asp.net网站i上,已经过密码验证.

对密码的限制,例如
1.必须有一个数字
2.必须有特殊符号
3.必须有大写字母和
4个密码长度必须恰好为8.

让用户选择条件为1,2& 2的密码. 3任意长度.可能您可以设置一个限制,例如密码必须至少为8/6

该怎么做.

我的代码是


In my asp.net website i,Have a password validation.

constraints on passwords like
1. Must have a digit
2. Must have special symbol
3. Must have Capital letter and
4 password length must be exactly 8.

let the users choose a password with criteria 1 , 2 & 3 with any length. May be you can put a restriction like password must be of minimum 8/6

how to do this.

my code is


<asp:TextBox ID="txtNewPassword" runat="server" CssClass="mmbrPro_tblClm2txtBX" TextMode="Password"

                    ></asp:TextBox>


                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"

                                       ControlToValidate="txtNewPassword"

                                       ErrorMessage="&lt;br /&gt; * must contain at least one digit!&lt;br /&gt; * must contain at least one uppercase character&lt;br /&gt; * must contain at least one special symbol&lt;br /&gt; * length should be 8 characters "

                                       Font-Bold="True" Font-Size="Small"

                                       ValidationExpression="((?=.*\d)(?=.*[A-Z])(?=.*\W).{8,8})"

                                       ValidationGroup="Save"></asp:RegularExpressionValidator>

推荐答案

使用以下链接

http://www.webpronews.com/validating-strong-passwords- in-c-and-aspnet-2006-12 [ ^ ]

谢谢,
Abhimanyu Rawat
use the following link

http://www.webpronews.com/validating-strong-passwords-in-c-and-aspnet-2006-12[^]

Thanks,
Abhimanyu Rawat


安全编码技术:更好的C#密码对话框 [ ^ ]

C#随机字符串生成器 [
Secure Coding Technique: A Better C# Password Dialog Box[^]

C# Random String Generator[^]

Check this links for your answer


这篇关于密码验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆