本文整理汇总了C#中MembershipCreateStatus.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MembershipCreateStatus.ToString方法的具体用法?C# MembershipCreateStatus.ToString怎么用?C# MembershipCreateStatus.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MembershipCreateStatus
的用法示例。
在下文中一共展示了MembershipCreateStatus.ToString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ErrorCodeToString
private static string ErrorCodeToString(MembershipCreateStatus createStatus)
{
string statusString = createStatus.ToString();
string resourceKey = "Exceptions.ErrorMessages.UserRegister.{0}".FormatWith(statusString);
return ResourceManager.GetString(resourceKey);
}
示例2: Save
public bool Save()
{
string[] nameAndMail = Alias.Split("|".ToCharArray());
string name = nameAndMail[0];
string email = nameAndMail.Length > 0 ? nameAndMail[1] : "";
string password = nameAndMail.Length > 1 ? nameAndMail[2] : "";
string loginName = nameAndMail.Length > 2 ? nameAndMail[3] : "";
if (cms.businesslogic.member.Member.InUmbracoMemberMode() && TypeID != -1)
{
cms.businesslogic.member.MemberType dt = new cms.businesslogic.member.MemberType(TypeID);
cms.businesslogic.member.Member m = cms.businesslogic.member.Member.MakeNew(name, loginName, email, dt, BusinessLogic.User.GetUser(_userID));
m.Password = password;
m.LoginName = loginName.Replace(" ", "").ToLower();
NewMemberUIEventArgs e = new NewMemberUIEventArgs();
this.OnNewMember(e, password, m);
_returnUrl = "members/editMember.aspx?id=" + m.Id.ToString();
}
else
{
MembershipCreateStatus mc = new MembershipCreateStatus();
Membership.CreateUser(name, password, email, "empty", "empty", true, out mc);
if (mc != MembershipCreateStatus.Success)
{
throw new Exception("Error creating Member: " + mc.ToString());
}
_returnUrl = "members/editMember.aspx?id=" + System.Web.HttpContext.Current.Server.UrlEncode(name);
}
return true;
}
示例3: SSOMembershipCreateResponse
public SSOMembershipCreateResponse(MembershipCreateStatus status, string userName)
{
_status = status.ToString();
_userName = userName;
}
示例4: MembershipCreateUserException
public MembershipCreateUserException (MembershipCreateStatus statusCode) : base (statusCode.ToString ())
{
this.statusCode = statusCode;
}
示例5: InvalidUserException
/// <summary>
/// Initializes a new instance of the <see cref="InvalidUserException"/> class.
/// </summary>
/// <param name="status">The status.</param>
public InvalidUserException(MembershipCreateStatus status)
: base(status.ToString())
{
Status = status;
}
示例6: AP_SaveButton_Click
protected void AP_SaveButton_Click(object sender, EventArgs e)
{
MembershipCreateStatus status = new MembershipCreateStatus();
MembershipUser muser = Membership.CreateUser(AP_UsernameTextBox.Text.Trim(), AP_PasswordTextBox.Text.Trim(), AP_EmailTextBox.Text.Trim(), questionKey, answerKey, true, out status);
if (status == MembershipCreateStatus.Success)
{
Roles.AddUserToRoles(AP_UsernameTextBox.Text.Trim(), GetSelectedList(AP_RoleCheckBoxList));
ActionName = ListPanel.ID;
InfoMessage("Yeni kullanýcý eklendi");
}
else
{
ErrorMessage(status.ToString());
}
}
示例7: GetErrorCodeFromString
protected virtual string GetErrorCodeFromString(MembershipCreateStatus createStatus)
{
return createStatus.ToString();
}
示例8: ErrorMessage
public string ErrorMessage(MembershipCreateStatus status)
{
return status.ToString();
}
示例9: LogCreateUserError
private void LogCreateUserError(MembershipCreateStatus status, string username)
{
string reasonText = status.ToString();
switch (status)
{
case MembershipCreateStatus.DuplicateEmail:
case MembershipCreateStatus.DuplicateProviderUserKey:
case MembershipCreateStatus.DuplicateUserName:
reasonText = "The user details you entered are already registered.";
break;
case MembershipCreateStatus.InvalidAnswer:
case MembershipCreateStatus.InvalidEmail:
case MembershipCreateStatus.InvalidProviderUserKey:
case MembershipCreateStatus.InvalidQuestion:
case MembershipCreateStatus.InvalidUserName:
case MembershipCreateStatus.InvalidPassword:
reasonText = string.Format("The {0} provided was invalid.", status.ToString().Substring(7));
break;
default:
reasonText = "Due to an unknown problem, we were not able to register you at this time";
break;
}
}
示例10: ErrorCodeToString
private static string ErrorCodeToString(MembershipCreateStatus createStatus)
{
// See http://msdn.microsoft.com/en-us/library/system.web.security.membershipcreatestatus.aspx for
// a full list of status codes and add appropriate error handling.
switch (createStatus)
{
case MembershipCreateStatus.DuplicateUserName:
return ClientCultureBasedResources.GetResource(() => ErrorResources.MembershipCreateStatusDuplicateUserName);
case MembershipCreateStatus.DuplicateEmail:
return ClientCultureBasedResources.GetResource(() => ErrorResources.MembershipCreateStatusDuplicateEmail);
case MembershipCreateStatus.ProviderError:
return ClientCultureBasedResources.GetResource(() => ErrorResources.MembershipCreateStatusProviderError);
case MembershipCreateStatus.UserRejected:
return ClientCultureBasedResources.GetResource(() => ErrorResources.MembershipCreateStatusUserRejected);
case MembershipCreateStatus.InvalidPassword:
case MembershipCreateStatus.InvalidEmail:
case MembershipCreateStatus.InvalidAnswer:
case MembershipCreateStatus.InvalidQuestion:
case MembershipCreateStatus.InvalidUserName:
// All this errors should have been handled by the UI validation so theoretically
// we should never get to this point
return "Validation Error: " + createStatus.ToString();
default:
return "Could not register the user, please verify the provided information and try again.";
}
}