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批量计算气象数据多
- 下一篇: c# char unsigned_dll