本文整理汇总了C#中System.Web.HttpCookieCollection.Get方法的典型用法代码示例。如果您正苦于以下问题:C# HttpCookieCollection.Get方法的具体用法?C# HttpCookieCollection.Get怎么用?C# HttpCookieCollection.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了HttpCookieCollection.Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: for
int loop1;
HttpCookie MyCookie;
HttpCookieCollection MyCookieCollection = Response.Cookies;
for(loop1 = 0; loop1 < MyCookieCollection.Count; loop1++)
{
MyCookie = MyCookieCollection.Get(loop1);
if(MyCookie.Value == "LastVisit")
{
MyCookie.Value = DateTime.Now.ToString();
MyCookieCollection.Set(MyCookie);
}
}
示例2:
HttpCookieCollection MyCookieCollection = Request.Cookies;
HttpCookie MyCookie = MyCookieCollection.Get("LastVisit");
MyCookie.Value = DateTime.Now.ToString();
MyCookieCollection.Set(MyCookie);