if(!IsPostBack) { UserInfo userInfo = Session["userInfo"] as UserInfo; if (userInfo == null) { Response.Redirect("Login.aspx"); } else if (userInfo.UserName != "王浡" && userInfo.PassWord != "wangbo") { Response.Redirect("Login.aspx"); } else { HttpCookie cookie; int count = 1; string time = ""; if (Request.Cookies["Test"] == null) { cookie = new HttpCookie("Test"); } else { cookie = Request.Cookies["Test"]; count = int.Parse(cookie.Values["count"]); count++; time = cookie.Values["time"]; } cookie.Values["count"] = count.ToString(); cookie.Expires = DateTime.Now.AddDays(1); cookie.Values["time"] = DateTime.Now.ToString(); Response.Cookies.Add(cookie); lblMessage.Text = userInfo.UserName + "欢迎您!!!"; Response.Write("上次登录时间为:"+time+"<br>"); Response.Write("登录次数为:" + count + "<br>"); }
- 1
- yinxx112014-05-20不错的资源
- ttyrone2013-08-05还可以,有帮助,就是看的有点费劲
- lsy小白2014-11-23刚好能用上,适合我这次作业的要求
- 粉丝: 0
- 资源: 3
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助