📄 changepasswordquestionandanswer.ascx.cs
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -