?? fillquepwd.aspx.cs
字號(hào):
?using System;
using System.Data;
using System.Data.SqlClient;
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;
public partial class FrontDesk_FindPwd_FindPwd : System.Web.UI.Page
{
DataCon myCon = new DataCon();
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlconn = myCon.getCon();
sqlconn.Open();
SqlCommand sqlcom = new SqlCommand("select UserQuePwd from tb_User where UserID='"
+ Convert.ToString(Session["UserID"]) + "'", sqlconn);//接受FillUserID頁(yè)傳值
txtQuePwd.Text = Convert.ToString(sqlcom.ExecuteScalar());
sqlconn.Close();
}
protected void btnSure_Click(object sender, EventArgs e)
{
SqlConnection sqlconn = myCon.getCon();
sqlconn.Open();
SqlCommand sqlcom = new SqlCommand("select count(*) from tb_User where UserAnsPwd='"
+ txtAnsPwd.Text + "' and UserID='" + Convert.ToString(Session["UserID"]) + "'", sqlconn);
int count = Convert.ToInt32(sqlcom.ExecuteScalar());
if (count > 0)
{
Page.Response.Redirect("FindPwd.aspx");
}
else
{
Response.Write("<script>alert('提示問(wèn)題答案輸入有誤!');location='javascript:history.go(-1)'</script>");
return;
}
sqlconn.Close();
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -