首先在Global中写如下代码:
文本查看 打印 ? protected void Session_Start(Object sender, EventArgs e) ...{ ArrayList lstName=new ArrayList(); this.Application.Add("name",lstName); } //****************************************************************************************************8 protected void Session_End(Object sender, EventArgs e) ...{ Application.Lock(); string str=Session["name"].ToString(); ArrayList lstName=(ArrayList)this.Application["name"]; Application.UnLock(); } 然后在登陆页面写代码 文本查看 打印 ? string username=this.txtName.Text.Trim(); ArrayList lstName=(ArrayList)this.Application["name"]; foreach(string strname in lstName) ...{ if(username.Equals(strname)) ...{ Response.Redirect("User_Login.aspx"); } } lstName=(ArrayList)Application["name"]; lstName.Add(this.txtName.Text.Trim()); this.Application.Lock(); this.Application["name"]=lstName; Session["name"]=username; this.Application.UnLock(); this.Response.Redirect("main.aspx");转载于:https://www.cnblogs.com/Look_Sun/archive/2010/10/20/1856695.html
相关资源:垃圾分类数据集及代码