如果希望在C#里面创建快捷方式,大致可以参考下面的步骤
1. 添加对Windows Script Host Object Model的引用
2. 编写如下代码即可
using IWshRuntimeLibrary;
namespace CreateShortCutdemo
{
class Program
{
static void Main(string[] args)
{
WshShell shell = new WshShell();
WshShortcut shortcut = (WshShortcut)shell.CreateShortcut(@"E:\Temp\Test.lnk");
shortcut.TargetPath = @"E:\Temp\Play.htm";
shortcut.Save();
}
}
}