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();
            }
        }
    }

  • 相关阅读:
    ORACLE的自定义排序
    PDA上一个UDP通讯客户端
    构造
    sort()的使用
    VC2012链接mySql
    宏的一些代码
    试卷
    疑问
    代码1
    vector学习
  • 原文地址:https://www.cnblogs.com/chenxizhang/p/1257835.html
Copyright © 2011-2022 走看看