passwordrecovery.aspx.cs
资源名称:WebSite1.rar [点击查看]
上传用户:vtryaojia
上传日期:2020-04-18
资源大小:1214k
文件大小:2k
源码类别:
SCSI/ASPI
开发平台:
Others
- 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 System.Data.OleDb;
- public partial class passwordrecovery : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void PwrButton_Click(object sender, EventArgs e)
- {
- string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/zzu.mdb") + ";";
- OleDbConnection conn = new OleDbConnection(strConnection);
- conn.Open();
- OleDbCommand cmd1 = new OleDbCommand("select*from [Member] where Name='" + UserName.Text.ToString() + "'and PhoneCode='" + Telephone.Text.ToString() + "'");
- cmd1.Connection = conn;
- OleDbDataReader dr = cmd1.ExecuteReader();
- if (dr.Read())
- {
- Session["Name"]=UserName.Text.ToString();
- Session["PhoneCode"] = Telephone.Text.ToString();
- OleDbCommand cmd2 = new OleDbCommand("select password from [Member] where Name='" + UserName.Text.ToString() + "'and PhoneCode='" + Telephone.Text.ToString() + "'");
- cmd2.Connection = conn;
- message.Visible = true;
- message.Text = "你的密码是n" + dr["Password"].ToString().Trim();
- }
- else
- {
- Response.Write("<script>alert('不存在该用户!')</script>");
- }
- }
- }