Login.aspx.cs

(开头部分) 5KB

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

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.SqlClient;
public partial class Login : System.Web.UI.Page
{
    SqlConnection sqlconn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
    SqlHelper data = new SqlHelper();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Select1.Value == "管理员")
        {
            if (Session["VaildCode"].ToString().ToLower() == this.TextBox3.Text.ToLower())
            {
                SqlConnection con = new SqlConnection(SqlHelper.connstring);
                con.Open();
                SqlCommand cmd = new SqlCommand("select * from Admin where  Aname='" + this.TxtUserName.Value + "'and  Apwd='" + this.TxtPassword.Value + "' ", con);
                SqlDataReader sdr = cmd.ExecuteReader();
                if (sdr.Read())
                {
                    Session["Admin"] = sdr["Aname"].ToString();
                    Session["AdminId"] = sdr["id"].ToString();
                    Session["UserId"] = sdr["id"].ToString();
                    Session["UserName"] = sdr["Aname"].ToString();
                    Response.Write("<script language='javascript'>alert('登录成功');location.href='Admin/index.html'</script>");

                }

                else
                {
                    Response.Write("<script language='javascript'>alert('用户名或密码错误请重新登录');location.href='login.aspx'</script>");

                }
            }
            else
            {
                Response.Write("<script language='javascript'>alert('验证码错误');location.href='login.aspx'</script>");

            }
        }
        if (Select1.Value == "部门管理员")
        {
            if (Session["VaildCode"].ToString().ToLower() == this.TextBox3.Text.ToLower())
            {
                SqlConnection con = new SqlConnection(SqlHelper.connstring);
                con.Open();
                SqlCommand cmd = new SqlCommand("select * from TouSuType where  LoginName='" + this.TxtUserName.Value + "'and  LoginPwd='" + this.TxtPassword.Value + "' ", con);
                SqlDataReader sdr = cmd.ExecuteReader();
                if (sdr.Read())
后面还有 64 行代码,购买后查看完整代码

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

AI 解读 AI

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

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