⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.aspx.cs

📁 自己开发的一个wap手机网站源代码 公开代码供大家学习下载
💻 CS
字号:
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;
using System.Data.OleDb;

public partial class admins_Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Session["name"] = null;
        if (!base.IsPostBack)
        {
            this.Label4.Text = new randnum().randnu(4);
        }

    }
    protected static string GetConnString()
    {
        string str2 = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        string path = ConfigurationManager.ConnectionStrings["DBPaths"].ConnectionString;
        string str4 = HttpContext.Current.Server.MapPath(path);
        return (str2 + str4 + ";");
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if ((this.TextBox3.Text == "") || (this.TextBox3.Text != this.Label4.Text))
        {
            base.Response.Write("验证码不正确!");
        }
        else
        {
            DataSet dataSet = new DataSet();
            string connString = GetConnString();
            new OleDbDataAdapter("select count(*)  from vip where admins='" + this.TextBox1.Text + "'and paswwords ='" + this.TextBox2.Text + "' ;", connString).Fill(dataSet, "Tb1");
            if (dataSet.Tables[0].Rows[0][0].ToString() != "0")
            {
                this.Session["name"] = this.TextBox1.Text;
                base.Response.Redirect("list.aspx");
            }
            this.TextBox1.Text = "";
            this.TextBox2.Text = "";
            this.TextBox3.Text = "";
            this.Label4.Text = new randnum().randnu(4);
        }
    }

}

⌨️ 快捷键说明

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