没有合适的资源?快使用搜索试试~ 我知道了~
显示所有缓存 清除所有缓存 Asp.net(C#)
4星 · 超过85%的资源 需积分: 10 12 下载量 113 浏览量
2013-01-26
23:19:51
上传
评论
收藏 1KB TXT 举报
温馨提示
试读
2页
显示所有缓存 清除所有缓存 Asp.net(C#)
资源推荐
资源详情
资源评论
显示所有缓存 清除所有缓存 Asp.net(C#)
代码
//清除所有缓存
protected void RemoveAllCache()
{
System.Web.Caching.Cache _cache = HttpRuntime.Cache;
IDictionaryEnumerator CacheEnum = _cache.GetEnumerator();
ArrayList al = new ArrayList();
while (CacheEnum.MoveNext())
{
al.Add(CacheEnum.Key);
}
foreach (string key in al)
{
_cache.Remove(key);
}
show();
}
//显示所有缓存
void show()
{
string str = "";
IDictionaryEnumerator CacheEnum = HttpRuntime.Cache.GetEnumerator();
while (CacheEnum.MoveNext())
{
str += "缓存名<b>[" + CacheEnum.Key+"]</b><br />" ;
}
this.Label1.Text = "当前网站总缓存数:" + HttpRuntime.Cache.Count + "<br />"+str;
代码
//清除所有缓存
protected void RemoveAllCache()
{
System.Web.Caching.Cache _cache = HttpRuntime.Cache;
IDictionaryEnumerator CacheEnum = _cache.GetEnumerator();
ArrayList al = new ArrayList();
while (CacheEnum.MoveNext())
{
al.Add(CacheEnum.Key);
}
foreach (string key in al)
{
_cache.Remove(key);
}
show();
}
//显示所有缓存
void show()
{
string str = "";
IDictionaryEnumerator CacheEnum = HttpRuntime.Cache.GetEnumerator();
while (CacheEnum.MoveNext())
{
str += "缓存名<b>[" + CacheEnum.Key+"]</b><br />" ;
}
this.Label1.Text = "当前网站总缓存数:" + HttpRuntime.Cache.Count + "<br />"+str;
资源评论
- ppppppppph5315022982013-01-28缓存是个大问题,这个要是好用就帅了
- ogre_zl2019-01-16跟我现在的处理方法一样
crackzzz
- 粉丝: 1
- 资源: 40
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功