zoukankan      html  css  js  c++  java
  • C# 建立快捷方式

    private void CreateLink(string linkName, string ExeName,string Description)
            {
                WshShell shell = new WshShell();
                IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(linkName);
                shortcut.TargetPath = ExeName;
                shortcut.WorkingDirectory =Path.GetDirectoryName(ExeName);
                 
                shortcut.WindowStyle = 1;
                shortcut.Description = Description;
                shortcut.IconLocation = System.Environment.SystemDirectory + "\\" + "shell32.dll, 165";
                shortcut.Save();
            }
            private void button3_Click(object sender, EventArgs e)
            {
                CreateLink(Application.StartupPath + "/两权发证.lnk", @"D:\temp\安徽\安徽.mxd", "两权发证");
                //WshShell shell = new WshShell();
                //IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(
                //    Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) +
                //    "\\" + "Allen's Application.lnk"
                //    );
                //shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
                //shortcut.WorkingDirectory = System.Environment.CurrentDirectory;
                //shortcut.WindowStyle = 1;
                //shortcut.Description = "Launch Allen's Application";
                //shortcut.IconLocation = System.Environment.SystemDirectory + "\\" + "shell32.dll, 165";
                //shortcut.Save();
            }

    参考:http://www.cnblogs.com/allenlooplee/articles/228264.html?login=1

  • 相关阅读:
    centos 8.5设置nginx开机自动启动
    python利用Faker模块造测试数据(转载)
    结构化分析建模
    关于使用com.anjiplus依赖实现的验证码功能在linux服务器上失效的问题
    vue 子组件提交接口,父组件刷新数据
    vue 全局钩子:路由守卫
    Scala函数式编程基础
    Flink
    Scala面向对象编程
    Scala运算符
  • 原文地址:https://www.cnblogs.com/gisoracle/p/2432724.html
Copyright © 2011-2022 走看看