如何以编程方式清除MSIE / WinInet缓存? [英] How to clear MSIE/WinInet cache programmatically?

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

问题描述

我正在尝试使用Win32 API清除WinInet缓存-通过使缓存条目无效或删除它们(无关紧要)。除了遍历每个条目外,我找不到任何方法可以对整个缓存进行操作- C#中的示例

我相当确定依次使用FindFirst / FindNextUrlCacheEntry()和DeleteUrlCacheEntry()是确保它可在所有版本的IE上运行的唯一方法。 http://msdn.microsoft.com/zh-cn/library/aa384126(VS.85).aspx rel = nofollow noreferrer> FindNextUrlCacheGroup() DeleteUrlCacheGroup()与 CACHEGROUP_FLAG_FLUSHURL_ONDELETE,但您必须确保只删除所需的内容。例如,历史记录,Cookie和Internet临时文件都是缓存组。


I'm trying to clear out the WinInet cache using Win32 API - by invalidating the cache entries, or deleting them (doesn't matter). I can't find any way to do this for the whole cache (other than iterating over each entry - example in C#, another in VB) - is this even possible?

解决方案

I'm fairly certain doing the FindFirst/FindNextUrlCacheEntry() then DeleteUrlCacheEntry() is the only way to make sure it works across all versions of IE.

Alternatively you can use FindFirst/FindNextUrlCacheGroup() and DeleteUrlCacheGroup() with "CACHEGROUP_FLAG_FLUSHURL_ONDELETE" but you have to make sure you only delete what you want. For example, history, cookies and temporary internet files are all Cache groups.

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

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