温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:明日网上商城购物系统源码
当前文件:
MingriNetShop/Manger/Login.aspx.cs,打开代码结构图
MingriNetShop/Manger/Login.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.Data.SqlClient; 12
13
public partial class AdminManage_Login : System.Web.UI.Page 14
{ 15
MangerClass mcObj=new MangerClass (); 16
UserInfoClass uiObj = new UserInfoClass(); 17
protected void Page_Load(object sender, EventArgs e) 18
{ 19
if (!IsPostBack) 20
{ 21
labCode.Text = new randomCode().RandomNum(4);//产生验证码 22
} 23
} 24
protected void btnLogin_Click(object sender, EventArgs e) 25
{ 26
if (txtAdminName.Text.Trim() == "" || txtAdminPwd.Text.Trim() == "") 27
{ 28
Response.Write("<script>alert('登录名和密码不能为空!');location='javascript:history.go(-1)';</script>"); 29
30
} 31
else 32
{ 33
if (txtAdminCode.Text.Trim() == labCode.Text.Trim()) 34
{ 35
int P_Int_IsExists = mcObj.AExists(txtAdminName.Text.Trim(), txtAdminPwd.Text.Trim()); 36
if (P_Int_IsExists == 100) 37
{ 38
DataSet ds = mcObj.ReturnAIDs(txtAdminName.Text.Trim(), txtAdminPwd.Text.Trim(), "AInfo"); 39
40
Session["AID"] = Convert.ToInt32(ds.Tables["AInfo"].Rows[0][0].ToString()); 41
Session["Aname"] = ds.Tables["AInfo"].Rows[0][1].ToString(); 42
Response.Write("<script language=javascript>window.open('AdminIndex.aspx');window.close();</script>"); 43
} 44
else 45
{ 46
47
Response.Write("<script>alert('您输入的用户名或密码错误,请重新输入!');location='javascript:history.go(-1)';</script>"); 48
} 49
} 50
else 51
{ 52
Response.Write("<script>alert('验证码输入有误,请重新输入!');location='javascript:history.go(-1)';</script>"); 53
} 54
} 55
} 56
57
protected void btnCancel_Click(object sender, EventArgs e) 58
{ 59
Response.Write("<script>window.close();location='javascript:history.go(-1)';</script>"); 60
} 61
} 62




MangerClass mcObj

}