C#创建桌面快捷方式
生活随笔
收集整理的这篇文章主要介绍了
C#创建桌面快捷方式
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
1、添加引用Windows Script Host Object Model,并引用命名空间using IWshRuntimeLibrary;
2、代码
using System; using IWshRuntimeLibrary; using System.Windows.Forms;namespace WindowsFormsApplication1 {public partial class Form1 : Form{public Form1(){InitializeComponent();}public void CreateShortCut(){string DesktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop);//得到桌面文件夹WshShell shell = new WshShell();IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(Desk总结
以上是生活随笔为你收集整理的C#创建桌面快捷方式的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 利用Excel VBA批量计算气象数据多
- 下一篇: Visual Studio 2012 C