c# 生成桌面快捷方式 无需调用DLL
各种百度 Google 找了半天,全都充斥了调用 DLL 生成桌面快捷方式 的例子,结果在 Windows Server 平台,那个DLL 根本用不了。
后来终于找到了一个可以用的工具类,使用方法如下
WindowsShortcut.Shortcut sc = new WindowsShortcut.Shortcut(); sc.Path = this.currentDir + "/平台启动器.exe"; sc.WorkingDirectory = this.currentDir; sc.Description = "平台启动器"; string DesktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop);//得到桌面文件夹 sc.Save(DesktopPath + "/平台启动器.lnk");