How to remove the Cache starting with ‘cachedata_’

VB.NET Dim enumerator As IDictionaryEnumerator = Cache.GetEnumerator() While enumerator.MoveNext() Dim key As String = CType(CType(enumerator.Current, DictionaryEntry).Key, String) If key.StartsWith(‘cachedata_’) Then ’ Print it: Response.Write((‘Deleting key ‘ + key + ‘ ‘)) ’ Remove it: Cache.Remove(key) End If End While C# IDictionaryEnumerator enumerator = Cache.GetEnumerator(); while(enumerator.MoveNext()) { String key = (String) ((DictionaryEntry) enumerator.Current).Key; if(key.StartsWith(‘cachedata_’)) { // Print it: Response.Write(‘Deleting key ‘ + key + ‘ ‘); // Remove it: Cache.Remove(key); } }

Is there a Cache.RemoveAll()? How can I clear / remove the total cache

VB.NET Dim objItem As DictionaryEntry For Each objItem In Cache ’Response.Write (objItem.Key.ToString ()); Cache.Remove(objItem.Key.ToString()) Next C# foreach(DictionaryEntry objItem in Cache) { //Response.Write (objItem.Key.ToString ()); Cache.Remove(objItem.Key.ToString () ) ; }

How to display items stored in a local application Cache

VB.NET Dim objItem As DictionaryEntry For Each objItem In Cache Response.Write((‘Key :’ + objItem.Key.ToString() + ‘ ‘)) Response.Write((‘ Value :’ + objItem.Value.ToString() + ‘ ‘)) Next C# foreach(DictionaryEntry objItem in Cache) { Response.Write (‘Key :’ + objItem.Key.ToString () + ‘ ‘); Response.Write(‘ Value :’ + objItem.Value.ToString ()+ ‘ ‘ ) ; }