Web/Login.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace Maticsoft.Web
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.TextBox1.Text == "") 
            {
                Response.Write("<script>javascript:alert('用户名不能为空');</script>");
                return;
            }
            if (this.TextBox2.Text == "")
            {
                Response.Write("<script>javascript:alert('密码不能为空');</script>");
                return;
            }
            BLL.allusers bll = new Maticsoft.BLL.allusers();
            string strsql = " username='" + this.TextBox1.Text + "' and pwd='" + this.TextBox2.Text + "'";
            DataSet ds = bll.GetList(strsql);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Session["id"] = ds.Tables[0].Rows[0]["ID"].ToString();
                Session["Name"] = this.TextBox1.Text;
                Session["Pass"] = this.TextBox2.Text;
                Response.Redirect("Default.aspx");
            }
            else 
            {
                Response.Write("<script>javascript:alert('用户名或密码错误');</script>");
            }
        }
    }
}

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

AI 解读 AI

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

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