zoukankan      html  css  js  c++  java
  • C#创建桌面快捷方式 和 开机启动

              /// <summary>
            /// 创建桌面快捷方式 2010-11-25
            /// </summary>
            private static void CreateDesktopShortCut()
            {
                string desktop = Environment .GetFolderPath(Environment. SpecialFolder.Desktop) + "\广州MES 系统appref-ms";
     
                if (System.IO.File .Exists(desktop))
                    return;
                //System.IO.File.Delete(desktop);
     
                //判断路径是否存在
                bool findpath = false ;
     
                string strpath = Environment .GetFolderPath(Environment. SpecialFolder.StartMenu) + "\程序\ 北京中软国际信息技术有限公司 \广州MES 系统appref-ms";
     
                if (System.IO.File .Exists(strpath))
                {
                    findpath = true;
                }
                else
                {
                    strpath = Environment.GetFolderPath(Environment .SpecialFolder.StartMenu) + "\Programs\ 北京中软国际信息技术有限公司 \广州MES 系统appref-ms";
                    if (System.IO.File .Exists(strpath))
                        findpath = true;
                }
     
                if (findpath)
                    System.IO. File.Copy(strpath, Environment .GetFolderPath(Environment. SpecialFolder.Desktop) + "\ 广州MES系统 appref-ms", true );
            }
  • 相关阅读:
    寒假周总结一
    1657. Determine if Two Strings Are Close
    1656. Design an Ordered Stream
    695. Max Area of Island (BFS)
    695. Max Area of Island (DFS)
    Daily Coding Problem: Problem #713
    939. Minimum Area Rectangle
    259. 3Sum Smaller
    29. Divide Two Integers
    16. 3Sum Closest
  • 原文地址:https://www.cnblogs.com/CharlesGrant/p/3650929.html
Copyright © 2011-2022 走看看