if(登录成功)
{
string key=this.txbusername.Text.Trim();
string username=Convert.ToString(Cache[Key]);
if(username==null||username=string.Emtry)
{
TimeSpan sessiontime=new TimeSpan(0,0,Session.Timeout,0,0);
Cache.Insert(key,key,null,DateTime.MaxValue,sessiontime,System.Web.Caching.CacheItemPriority.NotRemovable,null);
Session["username"] = this.txbusername.Text.Trim();
Response.Redirect("Default.aspx");
}
else
{
Response.Write("<script language='javascript'>alert('你已登录,不要重复登录!');</script>");
}
}
else
{
Response.Write("<script language='javascript'> alert('登录失败!');</script>");
}
防止用户重复登录
最新推荐文章于 2022-03-23 11:27:05 发布