Membership.CreateUser 问题

发布于 2024-08-02 01:23:14 字数 686 浏览 4 评论 0原文

这里报告了一个问题 ASP.NET 会员注册问题总结了我遇到的情况。 我不确定我是否理解所声称的解决方案。

简而言之,在调用此行后:

MembershipUser user = Membership.CreateUser(username, password, email, question, answer, true, out status);

我遇到了一种情况,其中

status != MembershipCreateStatus.Success || user == null 

条目已添加到表中:aspnet Users 和 aspnet Membership。

这是我的 web.config 中的内容

 passwordStrengthRegularExpression="" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"

有人可以启发我如何重现此问题,以便我可以修复代码中的相关问题吗?

There is an issue reported here
ASP.NET Membership Issues With Registration which summarizes a situation I am experiencing. I'm not sure I understand the claimed solution.

Simply put, after invoking this line:

MembershipUser user = Membership.CreateUser(username, password, email, question, answer, true, out status);

I run into a situation where

status != MembershipCreateStatus.Success || user == null 

yet entries are added to the tables: aspnet Users and aspnet Membership.

Here is what I have in my web.config

 passwordStrengthRegularExpression="" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"

Can someone enlighten me on how to reproduce this issue so that I can fix the related issue in my code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清风无影 2024-08-09 01:23:14

如果您的 MembershipCreateStatus.Success 为 != 成功,那么您是否检查了其他枚举值,看看其中之一是否为您提供了更多线索:

DuplicateUserName、DuplicateEmail、InvalidPassword、InvalidEmail、InvalidAnswer、InvalidQuestion、InvalidUserName、ProviderError、UserRejected

If your MembershipCreateStatus.Success is != to success then have you checked the other enumeration values to see if one of them give you more of a clue:

DuplicateUserName, DuplicateEmail, InvalidPassword, InvalidEmail, InvalidAnswer, InvalidQuestion, InvalidUserName, ProviderError, UserRejected

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文