Default.aspx.cs

(开头部分) 1KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

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

    }
    protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
    {
        if (TxtUserName.Text == "" && TxtPassword.Text == "")
        {
            Response.Write("<script>javascript:alert('用户名或密码不能为空!');</script>");
            return;
        }
        string strsql = "";
        if (this.Identify.Text == "管理员")
        {
            strsql = " select * from admin where adminUsername='" + TxtUserName.Text + "' and adminPassword='" + TxtPassword.Text + "'";
        }
        else if (this.Identify.Text == "企业用户")
        {
            strsql = " select * from qiye where bianhao='" + TxtUserName.Text + "' and mima='" + TxtPassword.Text + "'";
        }
        else
        {
            strsql = " select * from xuesheng where xuehao='" + TxtUserName.Text + "' and mima='" + TxtPassword.Text + "'";
        }
        DataSet ds = sqlconn.dataquery(strsql);
        if (ds.Tables[0].Rows.Count > 0)
        {
            Session["Flag"] = this.Identify.Text;
            Session["mima"] = TxtPassword.Text;
            Session["UserName"] = TxtUserName.Text;
            if (this.Identify.Text == "管理员")
            {
                Response.Redirect("admin/Default.aspx");
            }
            else if (this.Identify.Text == "企业用户")
            {
                Response.Redirect("qiye/Default.aspx");
            }
            else
            {
                Response.Redirect("xuesheng/Default.aspx");

            }
        }
        else
        {
            Response.Write("<script>javascript:alert('用户名或密码错误!');</script>");
            return;
        }
    }
后面还有 1 行代码,购买后查看完整代码

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

AI 解读 AI

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

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