“临时Internet文件”在Windows上的文件夹 [英] "Temporary Internet Files" folder on Windows

查看:162
本文介绍了“临时Internet文件”在Windows上的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Java程序需要删除由程序创建的Shell.Explorer.1ActiveX控件创建的临时Internet文件。



什么是最好的方法来做到这一点?



如果我在Internet Explorer中的工具 - > Internet选项,单击常规选项卡上的浏览历史记录设置按钮,然后单击查看文件按钮,它将我带到这个文件夹使用Windows资源管理器:

  C:\ Documents and Settings \< user-name> \ Local Settings \ Temporary Internet Files 

然后我看到一个files ,虽然我不确定他们真的是档案。然而,当我调用 file.listFiles()其中<$ c $ c> file 是上面列出的目录,我没有看到我在Windows资源管理器中看到的任何文件。我看到我想到的是一些隐藏的文件夹。

解决方案

Temporary Internet Files是一个假装文件夹。您在资源管理器中看到的视图是磁盘上的实际文件(它们位于不可预知的命名子文件夹中)以及存储关于这些文件的元数据的Wininet Url缓存容器的组合(例如,它们来自哪个URL,到期日期等) 。如果你使用文件系统的API,你会得到实际的东西。但是,如果您使用shell API,则可以按照自己想要的方式枚举它们。尝试从SHParseDisplayName()开始并从那里开始。而且,是的,不知道如何在Java中做到这一点,但应该有一些方法可以从Java调用win32函数,对吧?


My Java program needs to delete any temporary internet files that were created by a "Shell.Explorer.1" ActiveX control created by the program.

What is the best way to do that?

If I go to Tools->Internet Options in Internet Explorer, click on the Browsing history Settings button on the General tab, and then click on the View files button, it takes me to this folder using Windows Explorer:

 C:\Documents and Settings\<user-name>\Local Settings\Temporary Internet Files

I then see a listing of "files", although I'm not sure they really are files. How do I delete these using Java?

However, when I call file.listFiles() where file is the directory listed above, I don't see any of the files I see in Windows Explorer. I see what I think are some hidden folders.

解决方案

Temporary Internet Files is a pretend folder. The view you see in Explorer is a combination of the actual files on disk, which live in securly unpredictably named subfolders, and the Wininet Url Cache Containers that store the metadata about the files (like what URL they came from, expiry date, etc). If you use filesystem APIs, you'll get what's actually there. If you use shell APIs, however, you can enumerate them in the way you want. Try starting with SHParseDisplayName() and go from there. And, yeah, dunno how to do it in Java, but there should be some way to call win32 functions from Java, right?

这篇关于“临时Internet文件”在Windows上的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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