On VB.NET I can do things like this to write out all the keys in the cache:
Dim oc As HttpContext = HttpContext.Current
For Each c As Object In oc.Cache
oc.Response.Write(c.Key.ToString())
Next
Although the .Key doesn’t come up in Intellisense the code works just fine.
How do I do the same in c#?
HttpContext oc = HttpContext.Current;
foreach (object c in oc.Cache)
{
oc.Response.Write(c.key.ToString());
}
It doesn’t like the .key. bit. I’m at a loss here. Any ideas how to access the key in this way?
Below code snap is working fine:
Thanks for your time