以编程方式删除 IE6 cookie
有没有办法以编程方式删除 IE6 cookies?我遇到过使用类似 RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 之类的 IE7 和 IE8 解决方案,但这不适用于 IE6。我尝试使用一个简单的批处理文件来删除临时 Internet 文件文件夹的内容,但由于某些文件正在使用而失败。
Is there a way to delete IE6 cookies programaticaly? I have come across solutions for IE7 and IE8 using something like RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
but this does not work for IE6. I've tried a simple batch file to delete the contents of temporary internet files folder but that fails due to some files being in use.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
执行此操作的正确方法是使用 WinINET 缓存枚举函数(FindFirstUrlCacheEntry、FindNextUrlCacheEntry)来枚举 cookie 存储,然后对每个 cookie 调用 DeleteUrlCacheEntry。
http://support.microsoft.com/kb/326201 有一个相关的代码示例可以帮助您开始了。
如果您只是在寻找可编写脚本的解决方案并且实际上不需要将代码集成到某个更大的项目中,那么有许多命令行实用程序可以执行此操作...
The proper way to do this is to use the WinINET cache enumeration functions (FindFirstUrlCacheEntry, FindNextUrlCacheEntry) to enumerate the cookie store, then call DeleteUrlCacheEntry on each cookie.
http://support.microsoft.com/kb/326201 has a related code sample to get you started.
There are many command line utilities that will do this if you're just looking for a scriptable solution and don't actually need to integrate the code into some larger project...