如何以编程方式清除浏览器缓存?

如何以编程方式清除浏览器缓存?

问题描述:

我尝试以编程方式清除firefox 8浏览器缓存.我正在使用asp.net开发站点,出于安全原因,我需要清除浏览器缓存.我尝试了多种清除缓存的方法,但似乎没有任何效果.有什么想法吗?

I try to clear the firefox 8 browser cache using programmatically. I am developing as a site using asp.net, I need to clear the browser cache for the security reason. I tried many ways to clear the cache but none seems to work. Any ideas?

是的,但是可以做到......

Yes you can do it But........

由于浏览器安全性原因,您无法通过代码清除浏览器的历史记录.

You can't clear a browser's history via code because of browsers security reasons.

但是您可以使用以下方法删除浏览器缓存"目录下的所有文件和文件夹: 文件操作.

But you can delete all the files and folders under browsers "cache" directory using file operation.

例如Mozilla的默认缓存位置(隐藏)为 "..AppData \ Local \ Mozilla \ Firefox \ Profiles \ 2nfq77n2.default \ Cache"

eg. Mozilla's default cache location(hidden) is "..AppData\Local\Mozilla\Firefox\Profiles\2nfq77n2.default\Cache"

如何删除文件夹中的所有文件和文件夹目录? 试试吧!