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);
}
}
Share with