⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deep_login.aspx.cs

📁 【程序主要功能】 1、精简的增删改查
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OleDb;


public partial class admin_deep_login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        string strConnection = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
        OleDbConnection objConnection = new OleDbConnection(strConnection);
        objConnection.Open();

        string strsql = "select * from tAdmin where adminName='" + txtUserName.Text + "' and password='" + txtPassWord.Text + "' ";
        OleDbCommand objCommand = new OleDbCommand(strsql, objConnection);
        OleDbDataReader dr = objCommand.ExecuteReader();
        if (dr.Read())
        {
            //验证码检查
            if(this.txtChkcode.Text== Session["code"].ToString() ){
            Session["adminName"] = txtUserName.Text;
            OKInfo.Text = "登陆成功!!!";
            Response.Redirect("manage.aspx");
            }else{
                OKInfo.Text = "验证码错误!!!";    
            }

        }
        else
        {
            Session["adminName"] = null;
            OKInfo.Text = "用户名或密码错误,登陆不成功!!!";
        }
        dr.Close();

        objConnection.Close();


    }
}

⌨️ 快捷键说明

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