📄 login.aspx.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 + -