首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

c# 生成圆桌面快捷方式 无需调用DLL

2012-12-25 
c# 生成桌面快捷方式无需调用DLL各种百度 Google 找了半天,全都充斥了调用 DLL 生成桌面快捷方式 的例子,

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");

热点排行