You're here: Snippet Directory » Microsoft .NET » ASP.NET (64)
Language:

Cache leeren

Language: Deutsch
Programming Language: C#
Published by: Kai
Last Update: 5/8/2006
Views: 1528

Description

Mit dieser Methode werden alle vorhandenen Cache Items gelöscht.

Code

1 private void DeleteAllCacheItems() 2 { 3 HttpContext ctx = HttpContext.Current; 4 5 IDictionaryEnumerator d = ctx.Cache.GetEnumerator(); 6 7 while(d.MoveNext()) 8 { 9 ctx.Cache.Remove(d.Key.ToString()); 10 } 11 12 }

3 comments

1

Wie wär's denn mit HttpContext.Current.Cache.Clear()? *g*

Monday, May 08, 2006 6:07:54 PM from Thomas
2

Wieso einfach, wenns kompliziert geht? ;-)

Monday, January 01, 0001 12:00:00 AM from Peter Bucher
3

test :-)

Monday, January 01, 0001 12:00:00 AM from Thomas

Add a comment

Name *  

Email (won't be displayed) *    

Website  

Comment *  

Sicherheitscode Security Code *    

RSS