?? 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;
public partial class manage_login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session.Contents["admin"] != null)
Session.Contents["admin"] = null;
}
protected void button_Login_Click(object sender, EventArgs e)
{
string username = this.Text_Admin.Text.Trim();
string password = this.Text_PassWord.Text.Trim();
string validate = this.Text_Validate.Text;
int purview=1;
Md5Pw md5 = new Md5Pw();
if (username.Length > 0 && username.Length < 11 && password.Length > 3 && password.Length < 11 && Session.Contents["validate"] != null && validate == Session.Contents["validate"].ToString() && SqlStore.SqlAdminLogin(username, md5.Md5(password),out purview))
{
Session.Contents["validate"] = null;
Session.Add("username", username);//普通登陸
Session.Add("admin", purview);//管理登陸
Response.Redirect("default.aspx");
}
Response.Write("<script language='javascript' type='text/javascript'>alert('登陸失敗!');</script>");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -