存:
HttpCookie cookieStartTime = new HttpCookie(this.ToString() + "startTime", txtStartTime.Text);
Response.Cookies.Add(cookieStartTime);HttpCookie cookieEndTime = new HttpCookie(this.ToString() + "endTime", txtEndTime.Text);
Response.Cookies.Add(cookieEndTime);
取:
if (Request.Cookies[this.ToString() + "startTime"] != null)
{
txtStartTime.Text = Request.Cookies[this.ToString() + "startTime"].Value;
}
if (Request.Cookies[this.ToString() + "endTime"] != null)
{
txtEndTime.Text = Request.Cookies[this.ToString() + "endTime"].Value;
}
本文详细介绍了如何在ASP.NET中使用HTTP Cookie进行数据存储与获取的过程,包括创建、添加及读取Cookie的方法。
2719

被折叠的 条评论
为什么被折叠?



