当前位置: 首页>>代码示例>>C#>>正文


C# MembershipUser.ChangePasswordQuestionAndAnswer方法代码示例

本文整理汇总了C#中System.Web.Security.MembershipUser.ChangePasswordQuestionAndAnswer方法的典型用法代码示例。如果您正苦于以下问题:C# MembershipUser.ChangePasswordQuestionAndAnswer方法的具体用法?C# MembershipUser.ChangePasswordQuestionAndAnswer怎么用?C# MembershipUser.ChangePasswordQuestionAndAnswer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.Security.MembershipUser的用法示例。


在下文中一共展示了MembershipUser.ChangePasswordQuestionAndAnswer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeSecurityQuestionAndAnswer

 /// <summary>
 /// Change security question and answer
 /// </summary>
 /// <param name="user">Membership user</param>
 /// <param name="password">current password</param>
 /// <param name="newQuestion">new question</param>
 /// <param name="newAnswer">new answer</param>
 /// <returns>Return true if security question changed</returns>
 public bool ChangeSecurityQuestionAndAnswer(MembershipUser user, string password, string newQuestion,
                                             string newAnswer)
 {
     return user.ChangePasswordQuestionAndAnswer(password, newQuestion, newAnswer);
 }
开发者ID:ognjenm,项目名称:egle,代码行数:13,代码来源:EviivoMembership.cs

示例2: ChangePasswordQAHelper

 private void ChangePasswordQAHelper(MembershipUser user, string pw, string newQ, string newA)
 {
     try
     {
         user.ChangePasswordQuestionAndAnswer(pw, newQ, newA);
         Assert.Fail("This should not work.");
     }
     catch (ArgumentNullException ane)
     {
         Assert.AreEqual("password", ane.ParamName);
     }
     catch (ArgumentException)
     {
         Assert.IsNotNull(pw);
     }
 }
开发者ID:tdhieu,项目名称:openvss,代码行数:16,代码来源:UserManagement.cs

示例3: lbtnSecurity_Click

        /// <summary>
        /// this method is used to change the user Security question and answer //Developed by swaraj on 19 feb 2010
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbtnSecurity_Click(object sender, EventArgs e)
        {
            try
            {
                objMembershipUser = Membership.GetUser(User.Identity.Name);

                bool Result = objMembershipUser.ChangePasswordQuestionAndAnswer(txtPwd.Text.ToString(), txtSecurityQue.Text.ToString(), txtSecurityAns.Text.ToString());
                if (Result == true)
                {
                    lblMsg.ForeColor = System.Drawing.Color.Green;
                    lblMsg.Text = "Security Question and Answer has been changed successfully";
                    txtPwd.Text = "";
                    txtSecurityAns.Text = "";
                    txtSecurityQue.Text = "";
                }
                else
                {
                    lblMsg.ForeColor = System.Drawing.Color.Red;
                    lblMsg.Text = "Please verify the password";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:shekar348,项目名称:1PointOne,代码行数:31,代码来源:AccountSettings.aspx.cs


注:本文中的System.Web.Security.MembershipUser.ChangePasswordQuestionAndAnswer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。