idx.master.cs

(开头部分) 2KB

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

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

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

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text == "")
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('请输入用户名!');</script>");
            return;
        }

        if (TextBox2.Text == "")
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('请输入密码!');</script>");
            return;
        }
        string strsql = "";
        if (this.DropDownList1.Text == "学生用户")
        {
            strsql = "select * from members where lname='" + TextBox1.Text + "' and pass='" + TextBox2.Text + "'";
        }
        else 
        {
            strsql = "select * from jiedanren where lname='" + TextBox1.Text + "' and pass='" + TextBox2.Text + "' and Flag='审核通过'";
        }
        DataSet ds = DbHelperSQL.Query(strsql);
        //判断用户是否存在
        if (ds.Tables[0].Rows.Count > 0)
        {
            DataRow dr = ds.Tables[0].Rows[0];
                Session["yuer"] = dr["jiner"].ToString();
                Session["leixing"] = this.DropDownList1.Text;
                //把用户信息存入到Session
                Session["lname"] = dr["lname"].ToString();
                Session["tel"] = dr["tel"].ToString();
                if (this.DropDownList1.Text == "学生用户")
                {
                    Session["address"] = dr["address"].ToString();
                   
                }
                //跳转          
                Response.Redirect(Request.Url.ToString());
          
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('用户名或密码错误!');</script>");
            return;
        }
后面还有 6 行代码,购买后查看完整代码

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

AI 解读

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

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