如何使用MembershipValidatePasswordEventHandler?
在使用 asp 创建新用户时,有什么方法可以对密码选择进行一些限制吗?网会员。?
条件如
密码强度:
- 至少 8 个字符,并强制执行字符复杂性。即: 不包含用户的帐户名
- 长度至少为八个字符 包含
- 以下四个类别中三个类别的字符:
英文大写字符(A 到 Z)
英文小写字符(a 到 z)
10 基数(0 到 9)
非字母字符(例如 !、$、#、%)
Is there any way to put some restriction on password selection while creating new user with asp. net Membership.??
Condition Like
Password strength:
- Minimum of 8 characters, with character complexity enforced. ie: Not contain the user's account name
- Be at least eight characters in length
- Contain characters from three of the following four categories:
English uppercase characters (A through Z)
English lowercase characters (a through z)
Base 10 digits (0 through 9)
Non-alphabetic characters (for example, !, $, #, %)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下,您需要对 Web.config 进行一些修改。找到以下部分并进行相应更改
更新
首先,更新 web.config 中的会员配置部分,如下所示
然后,在您的帐户控制器中,替换您的注册操作(用
[HttpPost 装饰的操作) ]
)使用以下代码最后在注册操作下方添加 OnValidatePassword 的代码
希望这可以帮助您实现您想要的!
In this case, you need to make some modifications to your Web.config. Find the following section and change it accordingly
UPDATED
First, update your membership config section in web.config like following
Then, In your Account Controller, replace your Registration action(the one decorated with
[HttpPost]
) with the following codeAnd finally add the code for OnValidatePassword below the Registration Action
Hope this can help you achieve what you want !!