在ASP.NET中怎么获取用户登陆的次数(使用COOKIE)? 在ASP.NET中怎么用COOKIE获取用户登陆的次数?并且记录用户的信息,请教各位大虾~! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 登录的时候先取cookie,取到就加1.然后保存。 System.Web.HttpCookie cook = Request.Cookies["logtimes"]; if (cook == null) { cook =new System.Web.HttpCookie("logtimes", "0"); } cook.Expires = DateTime.Now.AddYears(1); string sValue = cook.Value; int iTimes = 0; int.TryParse(sValue, out iTimes); iTimes += 1; cook.Value = iTimes.ToString(); Response.Cookies.Add(cook); 小孔子开源OA系统部分功能源码已经发布 用javascript能实现判断中国IP段就跳转吗? javascript问题 字段多值的问题 _doPostBack问题 怎样为旅行社管理系统做操作日志? 大家帮忙解决下这个问题!!! DOTNETBAR不能在WEB应用程序中使用吗? winform和asp.net如何共用同一控件? 急急急? asp.net中自定义类库的问题 在JavaScript里访问C#变量
if (cook == null)
{
cook =new System.Web.HttpCookie("logtimes", "0");
}
cook.Expires = DateTime.Now.AddYears(1);
string sValue = cook.Value;
int iTimes = 0;
int.TryParse(sValue, out iTimes);
iTimes += 1; cook.Value = iTimes.ToString();
Response.Cookies.Add(cook);