gabe garza
5/14/2005 7:37:00 PM
Put this in a ASPX page in your web application, call it monitorcache.aspx,
for example.
NOTE: If this page is sensitive you''ll probably want to name it something
where nobody can access it (38fjfediwei239.aspx) or put it in Forms
Authentication so only certian people can access it. That''s up to you.
private void Page_Load(object sender, System.EventArgs e)
{
System.Collections.IDictionaryEnumerator ide = Page.Cache.GetEnumerator();
string skey;
object svalue;
// Go thru all your items in cache for the web application that this ASPX
page is in.
while(true == ide.MoveNext())
{
skey = ide.Key.ToString();
svalue = Cache[skey];
// Since the svalue object is unique to your web application you''ll just
have to add
// additional code to check the type and cast to your appropriate object
type
// to read and check your casted object for values.
// As in for example, how many records are in a cached recordset, etc...
// Since you have the key from cache, you can delete it from cache as
well.
}
}
This does work, any questions and I''ll post a C# example at my website.