idx.master.cs

(开头部分) 1KB

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

        DataSet ds = DbHelperSQL.Query("select * from members where lname='" + TextBox1.Text + "' and pass='" + TextBox2.Text + "'");

        //判断用户是否存在
        if (ds.Tables[0].Rows.Count > 0)
        {
            DataRow dr = ds.Tables[0].Rows[0];

           
                //把用户信息存入到Session
                Session["lname"] = dr["lname"].ToString();

                //跳转          
                Response.Redirect(Request.Url.ToString());
          
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('用户名或密码错误!');</script>");
            return;
        }
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        if (key.Value=="请输入关键字")
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('关键字不能为空!');</script>");
            return;
        }

        Response.Redirect("list.aspx?k="+Server.UrlEncode(key.Value));
    }
后面还有 1 行代码,购买后查看完整代码

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

AI 解读 AI

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

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