从cookie存储和检索值 [英] store and retrieve values from cookie
本文介绍了从cookie存储和检索值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我以以下方式将值存储到
i store the values to in following manner
HttpCookie UserCookieN = new HttpCookie("userInfo");
UserCookieN.Values["FrmType"] = Convert.ToString(Session["FrmType"]);
UserCookieN.Values["UserId"] = Convert.ToString(UserId);
UserCookieN.Values["BusId"] = Convert.ToString(BusId);
UserCookieN.Values["FY"] = Convert.ToString(DdlFY.SelectedValue);
UserCookieN.Values["RetType"] = Convert.ToString(DdlRetType.SelectedValue);
UserCookieN.Values["NatRet"] = Convert.ToString(DdlNatRet.SelectedValue);
UserCookieN.Values["Period"] = Convert.ToString(DdlPeriod.SelectedValue);
UserCookieN.Expires = DateTime.Now.AddYears(30);
Response.Cookies.Add(UserCookieN);
现在,对于特定的"FrmType",有多个UserId,BusId,FY,RetType,NatRet,Period的值
在获取值时,我想获取该FrmType的值.
Now for specific "FrmType" there are multiple values of UserId,BusId,FY,RetType,NatRet,Period
At time retrieving values i want to get the values for that FrmType .
推荐答案
导航以下链接.
http://msdn.microsoft.com/en-us/library/ms178194.aspx [ ^ ]
ASP.NET Cookie入门指南 [
Navigate the following links .
http://msdn.microsoft.com/en-us/library/ms178194.aspx[^]
Beginner''s Guide To ASP.NET Cookies[^]
这篇关于从cookie存储和检索值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文