#region 快捷方式
        private static void CreateDesktopLnk()
        {
            string DesktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop);
            if (DesktopPath.ToLower().Equals(Application.StartupPath.ToLower()) == false)
                CreateDesktopLnkEx(DesktopPath, ShortCutFileName);

            //string StartupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
            //CreateDesktopLnkEx(StartupPath, ShortCutFileName);
        }

        private static void CreateDesktopLnkEx(string LnkPath, string LnkFileName)
        {
            WshShell shell = new WshShell();
            IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(LnkPath + "\\" + LnkFileName);
            shortcut.TargetPath = Application.ExecutablePath;
            shortcut.Arguments = "";
            shortcut.Description = AppName;
            shortcut.WorkingDirectory = Application.StartupPath;
            shortcut.IconLocation = Application.ExecutablePath + ",0";
            shortcut.WindowStyle = 1;
            shortcut.Save();
        }
        #endregion

之前想着如何让应用开机启动的时候,有想着去添加注册表之类的,非常的麻烦,WIN7以上的系统还涉及到管理员权限的问题。其实最方便的实现方法就是直接在系统的“启动”目录下建立一个快捷方式。