/// <summary>
        ///     应用程序的主入口点。
        /// </summary>
        private static void Main(string[] args)
        {
            //Console.Title = "ProcessWindow服务程序";
            Console.Title = @"ProcessWindow服务程序";
            ConsoleWin32Helper.SetTitle(Console.Title);
            // 控制台运行
            //    System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()));
            //Log.Info("上海芸浦信息技术有限公司 版权所有2018");
            Log.Info("copyright@yumpoo2018");
            Log.Info(
                "说明 \n Tag的UpdateInterval的基数为毫秒 \n WaitAction的WaitTime基数是毫秒 \n Step的Wait的基数是秒 \n TimerCondition的Seconds是0.1秒 \n Action的默认超时是5秒");

            OpenWCFPorts();

            //if (args.Length > 0)
            //{
            //    var par = args[0].ToLower();
            //    if (par == "c" || par == "/c" || par == "-c" || par == "console")
            RunAsConsole();
            //}
            //else
            //{
            //    RunAsService();
            //}
        }
        private static void RunAsConsole()
        {
            StartProcessControlService();

            Log.Info("程序启动...");

#if Release
            ConsoleWin32Helper.ShowFlag = true;
            ConsoleWin32Helper.ShowNotifyIcon();
            ConsoleWin32Helper.ShowHideWindow();
            ConsoleWin32Helper.DisableCloseBtn();
            while (!ConsoleWin32Helper.ExitCall)
            {
                Thread.Sleep(100);
                Application.DoEvents();
            }
#endif
            //Console.ReadLine();
        }