码迷,mamicode.com
首页 > 其他好文 > 详细

清除所有Cookie

时间:2017-05-18 17:28:20      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:span   public   div   sum   runtime   system   void   nbsp   style   

代码

/// <summary>
        /// 清除所有Cookie
        /// </summary>
        public static void RemoveAll()
        {
            System.Web.Caching.Cache _cache = HttpRuntime.Cache;
            IDictionaryEnumerator CacheEnum = _cache.GetEnumerator();
            ArrayList al = new ArrayList();
            while (CacheEnum.MoveNext())
            {
                al.Add(CacheEnum.Key);
            }

            foreach (string key in al)
            {
                _cache.Remove(key);
            }
        }

 

清除所有Cookie

标签:span   public   div   sum   runtime   system   void   nbsp   style   

原文地址:http://www.cnblogs.com/xsj1989/p/6874423.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!