您当前的位置: 首页 >  c#

刘一哥GIS

暂无认证

  • 6浏览

    0关注

    934博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C#创建桌面快捷方式

刘一哥GIS 发布时间:2015-10-27 19:10:29 ,浏览量:6

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
关注
打赏
1665586602
查看更多评论
立即登录/注册

微信扫码登录

0.0703s