zoukankan      html  css  js  c++  java
  • 如何编程创建快捷方式?

    如果希望在C#里面创建快捷方式,大致可以参考下面的步骤

    1. 添加对Windows Script Host Object Model的引用

    image

    2. 编写如下代码即可

    using IWshRuntimeLibrary;
    namespace CreateShortCutdemo
    {
        class Program
        {
            static void Main(string[] args)
            {
                WshShell shell = new WshShell();
                WshShortcut shortcut = (WshShortcut)shell.CreateShortcut(@"E:\Temp\Test.lnk");
                shortcut.TargetPath = @"E:\Temp\Play.htm";
                shortcut.Save();
            }
        }
    }

  • 相关阅读:
    问题集
    第04次作业-树
    06-图
    05-查找
    04-树
    03-栈和队列
    02-线性表
    01-抽象数据类型
    C语言--总结报告
    C语言--函数嵌套
  • 原文地址:https://www.cnblogs.com/chenxizhang/p/1257835.html
Copyright © 2011-2022 走看看