changepasswordquestionandanswer.ascx.cs

来自「学生成绩管理系统 内有软件安装说明带论文源码齐全 结合ASP+数据库完美结合」· CS 代码 · 共 47 行

CS
47
字号
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TeachHelper.Comm;

public partial class TeachHelper_Controls_ChangePasswordQuestionAndAnswer : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.TextBoxQuestion.Text = Membership.GetUser().PasswordQuestion;
        }
    }

    protected void ButtonSubmit_Click(object sender, EventArgs e)
    {
        string pass = this.TextBoxPass.Text;
        string question = this.TextBoxQuestion.Text;
        string answer = this.TextBoxAnswer.Text;

        bool result = Membership.GetUser().ChangePasswordQuestionAndAnswer(pass, question, answer);

        string message;
        if (result)
            message = "更新成功";
        else
            message = "更新失败";

        MessageBox.Show(this.Page, message);
    }

    protected void ButtonCancel_Click(object sender, EventArgs e)
    {
        this.TextBoxQuestion.Text = Membership.GetUser().PasswordQuestion;
        this.TextBoxPass.Text = string.Empty;
        this.TextBoxAnswer.Text = string.Empty;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?