Windows 是否缓存 .url(Internet 快捷方式)文件的内容?
我正在 .NET 中实现自定义 URL 处理程序。为了测试这一点,我创建了几个不同的 .url
文件并将它们放在我的桌面上。这通常工作正常,但如果我更改文件的内容,特别是 URL=
行,则会表现得很奇怪。这样做没有任何效果——旧的 URL 会继续打开。但是,重命名该文件是有效的。该文件如下所示:
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,0
[InternetShortcut]
URL=myCustomScheme://some/url/pointing/somewhere
IDList=
我通过新建→快捷方式创建的所有快捷方式都接收相同的 UUID,因此更改它可能不会有帮助。
Windows 中是否有一些内部 .url 文件/URL 映射缓存?
I'm implementing a custom URL handler in .NET. To test this, I have created a few different .url
files and put them on my Desktop. This generally works fine, but behaves oddly if I change the file's contents, specifically the URL=
line. Doing so has no effect — the old URL continues to be opened. Renaming the file, however, works. The file looks like this:
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,0
[InternetShortcut]
URL=myCustomScheme://some/url/pointing/somewhere
IDList=
All shortcuts I create through New → Shortcut receive the same UUID, so changing that probably won't help.
Is there some internal .url file / URL mapping cache in Windows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我有理由相信 URL 文件在创建时由某些 Internet Explorer 组件解释
(不是圣经)。它们仅在第一次创建文件时被解释。以后对 URL 文件的任何修改都不会被提交。这是因为快捷方式未存储在文件中。这就是为什么稍后可以修改该文件以使其变为空的原因,因为它是一个 0 字节文件,并且 URL 文件看起来无论如何都可以工作。快捷方式数据作为NTFS文件系统中的文件属性存储在“Web文档”字段中。该文件仅用于指向它的目的。您也许能够以编程方式修改这些属性字段,这应该是“编辑文件”。编辑看似简单的文本文件是一项痛苦的工作。此外,一旦文件名用于 URL 文件,就无法将其重新用于新文件,无论将其保存到哪个磁盘或路径。因此,您必须继续为您创建的每个新 URL 文件分配以前从未使用过的唯一文件名。这与 Internet Explorer 缓存 Web 内容的方式有关。它会记住已经使用过的文件名,并将这些名称映射到先前定义的 URL 地址。要重复使用名称
(或者当您想不出新的且唯一的文件名时),您必须清除临时 Internet 文件。直接回答你的问题:是的,确实如此。
I have a reason to believe that URL files are interpreted by some Internet Explorer component at the time of creation
(not biblical). They are only interpreted initially, the first time the file is created. Any modifications to the URL file later on will not be committed. This is because the shortcut is not stored in the file. This is why the file can be modified later on so that it becomes empty, as a 0 byte file and the URL file will appear to be working anyway. The shortcut data is stored in the "Web Document" field as a file property in the NTFS file system. The file merely serves the purpose of pointing to it. You might be able to modify these property fields programmatically, which would supposedly "edit the file". It's a painful exercise just to edit what appears to be a simple text file.Additionally, once a file name has been used for a URL file, it cannot be reused for new files, no matter what disk or path you save it to. So you have to keep assigning unique file names, never used previously, for each new URL file you create. This has to do with how Internet Explorer caches web content. It remembers what file names have been used already and maps those names to previously defined URL addresses. To reuse a name
(or when you run out of ideas for new and unique file names)you have to clear Temporary Internet Files.To directly answer your question: yes, it does.
Windows 7 缓存您的文件名,有时,正如您所说,将文件名缓存在特定位置。
启动 regedit 并搜索以下内容
,其中 S-1-5-21-xxxx 是您当前登录的用户。
在那里您可以看到您曾经访问过的大多数(或全部?)文件已被缓存。
也许您还可以通过编程方式停用 MUICaching。也许这个网站可以帮助您: 禁用缓存
Windows 7 Caches your Filenames and sometimes, as you said, the filenames in specific locations.
Start regedit and search for the following
where S-1-5-21-x-x-x-x is your currently logged in User.
There you can see that most (or all?) files have been cached which you have ever accessed.
Maybe you can also deactivate the MUICaching programatically. Maybe this site helps you: Disable Caching
我也遇到过类似的问题,结果发现罪魁祸首是 Firefox。
如果您的网络浏览器碰巧是 Firefox,您的缓存目录可能已损坏。
您可以创建一个新的配置文件,或者抓住机会清理
C:\Users\\AppData\Local\Mozilla\Firefox\Profiles\\
中的内容I had a similar issue, and it turns out the culprit was Firefox.
If by chance your web browser is Firefox, your cache directories may be corrupted.
You can either create a new Profile, or take your chances cleaning things out of
C:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<profile>\
我发现我的桌面
.url
快捷方式内容缓存在%LocalAppData%\Microsoft\Windows\Caches
中。有一些(几个?)文件的文件名类似于
{}..ver0x.db
。其中两个缓存了.url
文件。不幸的是,我没有找到有关它们是什么或如何刷新它们的信息。每个人都只是在缓存清理操作中删除它们。
I've found my desktop
.url
shortcut contents cached in%LocalAppData%\Microsoft\Windows\Caches
.There are a few (several?) files with filenames like
{<SOME_GUID>}.<x>.ver0x<XXXXXXXXXXXXXXXX>.db
. Two of them had the.url
files cached.Unfortunately, I've found no information on what they are or how to refresh them. Everybody just deletes them as part of some cache clean-up operation.