login.aspx.cs

来自「多种模式留言系统 本留言系统 支持多种模式 一 签写留言模式 二 留言本模」· CS 代码 · 共 42 行

CS
42
字号
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 admin_login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string auid = uid.Text.ToString();
        int buid = Convert.ToInt32(odb.scr("select count(*) from [admin] where [uid]='" + auid + "'"));

        string apwd = pwd.Text.ToString();
        int bpwd = Convert.ToInt32(odb.scr("select count(*) from [admin] where [pwd]='" + apwd + "'"));

        if (buid > 0 && bpwd >0)
        {
            Session["qx"] = odb.scr("select qx from [admin] where [uid]='" + auid + "'");
            Session["uid"] = odb.scr("select uid from [admin] where [uid]='" + auid + "'"); ;

            Response.Redirect("admin.aspx");
        }
        else
        {
            if (buid <= 0)
                uid.Text = "用户名错误";
            if (bpwd <= 0)
                uid.Text = uid.Text + " & 密码错误";
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?