A.NET显示清除网站中的所有缓存_.NET概论及软件使用_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

A.NET显示清除网站中的所有缓存

作者:黑客防线网安ASP维护基地 来源:黑客防线网安ASP维护基地 浏览次数:0

本篇关键词:所有网站清除显示
黑客防线网安网讯:   //清除所有缓存protected void RemoveAllCache(){System.Web.Caching.Cache _cache = HttpRuntime.Cache;IDictionaryEnumerator CacheEnum = _cache.GetEnumerator();ArrayList al = new...

   //清除所有缓存

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 />" ;

}

//"当前网站总缓存数:" + HttpRuntime.Cache.Count + "<br />"+str;

}

 

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-14209-1.html
网站维护教程更新时间:2012-03-30 05:30:23  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer