logon.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
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.SqlClient;
using Mysqlserver;


public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.txt_user.Focus();
        if (!IsPostBack)
        {
           
            this.btn_clear.Attributes.Add("onclick", "return qingkong();");
            this.btn_ok.Attributes.Add("onclick", "return isNull();");
        }
    }
    protected void btn_enter_Click(object sender, EventArgs e)
    {

        if (DropDownList1.SelectedItem.Text == "管理员")
        {
            SqlServerDataBase db = new SqlServerDataBase();
            SqlConnection conn = db.DBconn();


            string upper_staff_id = this.txt_user.Text.Trim();
            upper_staff_id = upper_staff_id.ToUpper();
            string sqlStr = "select * from user_inf where (user_name='" + this.txt_user.Text.Trim() + "'or user_name='" + upper_staff_id + "') and user_psw='" + this.txt_pwd.Text.Trim() + "'";
            DataSet ds = db.Select(sqlStr, conn);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Session["user_name"] = ds.Tables[0].Rows[0]["user_name"].ToString();

                Session["user_right"] = ds.Tables[0].Rows[0]["user_right"].ToString();


                forwardModule();



            }
            else
            {
                Response.Write("<script>alert('用户名或密码错误,请重新输入!')</script>");
            }
        }

        if(DropDownList1.SelectedItem.Text == "教师")
        {
            SqlServerDataBase db = new SqlServerDataBase();
            SqlConnection conn = db.DBconn();
后面还有 68 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。