userlogin.aspx.cs

(完整代码) 1KB

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;

public partial class userlogin : System.Web.UI.Page
{
    String SqlStr;
    DB db = new DB();
    DataSet Ds = new DataSet();
    protected void Page_Load(object sender, EventArgs e)
    {
  
       

    }
    protected void imgBtnLogin_Click1(object sender, ImageClickEventArgs e)
    {
        SqlStr = "select * from 会员表 where 会员名='" + this.txt_User_Name.Text + "' and 密码='" + txt_User_Pwd.Text + "'";
        Ds = db.GetDataTableBySql(SqlStr);
        try
        {
            if (Ds.Tables[0].Rows.Count == 0)
            {
                this.Labinfo.Text = "用户名或密码错误,请重试!";
                this.txt_User_Name.Focus();
            }
            else
            {
                this.Labinfo.Text = "用户  " + this.txt_User_Name.Text + "  恭喜您登录成功!";
                Session["UserName"] = this.txt_User_Name.Text;
                Response.Redirect("Default.aspx");
            }
        }
        catch (Exception)
        {
            this.Labinfo.Text = "没有得到任何数据,请重试!";
        }
    }
}

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

AI 解读 AI

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

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