以编程方式在用户桌面上创建 Web 快捷方式 [英] Creating a web shortcut on user desktop programmatically
问题描述
有很多资源可用于以编程方式为桌面上的文件和程序创建 .lnk
类型的快捷方式,但我想知道如何创建指向 Web URL 的快捷方式.
There are quite a few resources for programmatically creating .lnk
type shortcuts to files and programs on the desktop but I'm wondering how to create a shortcut to a web URL.
据我所知,Web URL 快捷方式是一个以 .URL
结尾的文本文件,并包含一个类似 ini 的定义,例如:
From what I can gather, the web URL shortcut is a text file ending in .URL
and contains a ini-like definition such as:
[InternetShortcut]
URL=http://www.google.com/
但是,仅仅创建文件是不够的,您似乎还需要更改其元 URL
属性以包含相同的链接.
However, it's not enough to just create the file, it seems you also need to change its meta URL
properties to include the same link.
知道如何创建这些吗?
欢迎任何来自 .Net/Perl/batch 的示例代码.
Any sample code from .Net/Perl/batch is welcome.
推荐答案
您可以为任何 URI(包括 Web 地址)创建 .lnk 快捷方式.只需创建快捷方式并将目标设为您的网址而不是文件位置.
You can create .lnk shortcuts to any URI, including web addresses. Just create the shortcut and make the target your web address instead of a file location.
有关如何以编程方式执行此操作的其他问题,请参阅:
See this other question for how to do it programmatically:
这篇关于以编程方式在用户桌面上创建 Web 快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!