清除所有Cookie
阿新 • • 發佈:2017-05-18
static caching ict color nbsp blog runtime enume spa
代碼
/// <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