• 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

  • 相关阅读:
    Hia~hia~
    细节与销售
    敛财术
    酒井法子
    买了新手机NOKIA E71
    观《拉贝日记》
    居然不配套
    2009上海最新“四金”及个人所得税计算(器)
    有好听点的新歌么?
    我家乌龟终于下蛋了!
  • 原文地址:https://www.cnblogs.com/gisoracle/p/2432724.html
Copyright © 2020-2023  润新知