如何以编程方式清除浏览器缓存? [英] How to clear browser cache programmatically?

查看:203
本文介绍了如何以编程方式清除浏览器缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试以编程方式清除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"

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

这篇关于如何以编程方式清除浏览器缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆