gpt4 book ai didi

c# - 无法创建用户

转载 作者:太空宇宙 更新时间:2023-11-03 16:20:11 24 4
gpt4 key购买 nike

我使用 ASP.NET Membership 类来创建用户凭据和管理用户设置。代码如下:它在我的本地机器上运行良好,但在生产服务器上抛出异常。可能是什么原因?可以给我一个线索吗?有人吗?


try
{
MembershipUser newUser =
Membership.CreateUser(txtUserName.Text, txtPassword.Text);
}
catch (MembershipCreateUserException ex)
{
divErrorPanel1.Visible = true;
ShowErrorMessage(lblMessage, GetErrorMessage(ex.StatusCode));
return;
}

最佳答案

检查 MembershipCreateUserException.StatusCode用于解释异常的属性。

Gets a description of the reason for the exception.

这些都是可能性。

  • "Username already exists. Please enter a different user name.";

  • "A username for that e-mail address already exists. Please enter a different e-mail address.";

  • "The password provided is invalid. Please enter a valid password value.";

  • "The e-mail address provided is invalid. Please check the value and try again.";

  • "The password retrieval answer provided is invalid. Please check the value and try again.";

  • "The password retrieval question provided is invalid. Please check the value and try again.";

  • "The user name provided is invalid. Please check the value and try again.";

  • "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.";

  • "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator.";

  • "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.";

关于c# - 无法创建用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14275777/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com