Login.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 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;

/// <summary>
/// 登录页面
/// </summary>
public partial class login :PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    { 
    }

    /// <summary>
    /// 登录功能
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void IbtDL_Click(object sender, ImageClickEventArgs e)
    {
        DataTable dt = new DataTable();
        switch (RadioButtonList1.SelectedValue)
        {
            case "管理员":
                dt = DataControl.GetData("select * from 管理员 where 帐号='" + txtUser.Text + "' and 密码 ='" + txtPwd.Text + "'");
                if (dt.Rows.Count <= 0)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "<script>alert('帐号密码错误!');</script>");
                    return;
                }
                Session["UserID"] = txtUser.Text;
                Response.Redirect("Admin/index.aspx");
                break;
            case "导师":
                dt = DataControl.GetData("select * from 导师 where 帐号='" + txtUser.Text + "' and 密码 ='" + txtPwd.Text + "' ");
                if (dt.Rows.Count <= 0)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "<script>alert('帐号密码错误!');</script>");
                    return;
                }
                Session["UserID"] = txtUser.Text;
                Response.Redirect("DS/index.aspx");
                break;
            case "学生":
                dt = DataControl.GetData("select * from 学生 where 帐号='" + txtUser.Text + "' and 密码 ='" + txtPwd.Text + "' ");
                if (dt.Rows.Count <= 0)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "info", "<script>alert('帐号密码错误!');</script>");
                    return;
                }
                Session["UserID"] = txtUser.Text;
                Response.Redirect("XS/index.aspx");
                break;
后面还有 8 行代码,购买后查看完整代码

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

AI 解读 AI

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

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