示例#1
0
 public void Start()
 {
     //配置信息读取
     ConfigInit.InitConfig();
     QuartzHelper.InitScheduler();
     QuartzHelper.StartScheduler();
 }
示例#2
0
        protected override void OnStart(string[] args)
        {
            DebuggableAttribute att = System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttribute <DebuggableAttribute>();

            if (att.IsJITTrackingEnabled)
            {
                //Debug模式才让线程停止10s,方便附加到进程调试
                Thread.Sleep(10000);
            }
            //配置信息读取
            ConfigInit.Init();
            //3.系统参数配置初始化
            MefConfig.Init();
            ConfigManager configManager = MefConfig.TryResolve <ConfigManager>();

            configManager.Init();
            QuartzHelper.InitScheduler();
            QuartzHelper.StartScheduler();
            // 保持web服务运行
            ThreadPool.QueueUserWorkItem((o) =>
            {
                //启动站点
                Startup.Start(SystemConfig.WebHost, SystemConfig.WebPort);
            });
        }
示例#3
0
        static void Main(string[] args)
        {
            AdminRun.Run();
            ConfigInit.InitConfig();
            QuartzHelper.InitScheduler();
            QuartzHelper.StartScheduler();
            try
            {
                string url = string.Format("http://127.0.0.1:{0}", SysConfig.WebPort);
                //启动站点
                using (NancyHost host = Startup.Start(SysConfig.WebPort))
                {
                    //调用系统默认的浏览器
                    Process.Start(url);
                    Console.WriteLine("系统监听站点地址:{0}", url);
                    Console.WriteLine("程序已启动,按任意键退出");
                    Console.ReadLine();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }



            //ParseExpressCode();
            //ExpressUtil.HandleProecssInfo("");
            //MessageHelper.SendMessage(new Guid("6282AA73-2A58-E511-8D70-00155D0C740D"));
            //new Ywdsoft.Task.TaskSet.SendMessageJob().Execute(null);
            Console.Read();
        }
示例#4
0
 public void Start()
 {
     ////配置信息读取
     //ConfigInit.InitConfig();
     //初始化任务调度对象
     QuartzHelper.InitScheduler();
     // 启用任务调度
     // 启动调度时会把任务表中状态为“执行中”的任务加入到任务调度队列中
     QuartzHelper.StartScheduler();
 }
示例#5
0
        static void Main(string[] args)
        {
            AdminRun.Run();

            if (!SetConsoleCtrlHandler(cancelHandler, true))
            {
                Console.WriteLine("程序监听系统按键异常");
            }
            try
            {
                //1.MEF初始化
                MefConfig.Init();

                //2.数据库初始化连接
                ConfigInit.InitConfig();

                //3.系统参数配置初始化
                ConfigManager configManager = MefConfig.TryResolve <ConfigManager>();
                configManager.Init();

                Console.Title         = SystemConfig.ProgramName;
                Console.CursorVisible = false; //隐藏光标

                //4.任务启动
                QuartzHelper.InitScheduler();
                QuartzHelper.StartScheduler();

                //5.加载SQL信息到缓存中
                XmlCommandManager.LoadCommnads(SysConfig.XmlCommandFolder);

                //测试dapper orm框架
                //DapperDemoService.Test();

                //启动站点
                using (NancyHost host = Startup.Start(SystemConfig.WebPort))
                {
                    //调用系统默认的浏览器
                    string url = string.Format("http://127.0.0.1:{0}", SystemConfig.WebPort);
                    Process.Start(url);
                    Console.WriteLine("系统已启动,当前监听站点地址:{0}", url);

                    //4.消息队列启动
                    RabbitMQClient.InitClient();

                    //5.系统命令初始化
                    CommandHelp.Init();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.Read();
        }
 protected override void OnStart(string[] args)
 {
     //DebuggableAttribute att = System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttribute<DebuggableAttribute>();
     //if (att.IsJITTrackingEnabled)
     //{
     //    //Debug模式才让线程停止10s,方便附加到进程调试
     //    Thread.Sleep(10000);
     //}
     //配置信息读取
     ConfigInit.InitConfig();
     QuartzHelper.InitScheduler();
     QuartzHelper.StartScheduler();
 }
示例#7
0
        protected override void OnStart(string[] args)
        {
            try
            {
                //1.MEF初始化
                MefConfig.Init();

                //2.数据库初始化连接
                ConfigInit.InitConfig();

                //3.系统参数配置初始化
                ConfigManager configManager = MefConfig.TryResolve <ConfigManager>();
                configManager.Init();

                //4.任务启动
                QuartzHelper.InitScheduler();
                QuartzHelper.StartScheduler();

                //5.加载SQL信息到缓存中
                XmlCommandManager.LoadCommnads(SysConfig.XmlCommandFolder);
                //开发时监听资源文件变化,用于实时更新
                DevelperHelper.WatcherResourceChange();

                // 保持web服务运行
                ThreadPool.QueueUserWorkItem((o) =>
                {
                    //7.启动站点
                    using (NancyHost host = Startup.Start(SystemConfig.WebPort))
                    {
                        //调用系统默认的浏览器
                        string url = string.Format("http://127.0.0.1:{0}", SystemConfig.WebPort);
                        LogHelper.WriteLog(string.Format("系统已启动,当前监听站点地址:{0}", url));
                        try
                        {
                            //4.消息队列启动
                            RabbitMQClient.InitClient();
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex);
                        }
                        //8.系统命令初始化
                        CommandHelp.Init();
                    }
                });
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("服务启动异常", ex);
            }
        }
示例#8
0
        static void Main(string[] args)
        {
            //以管理员身份运行
            AdminRun.Run();

            //MEF初始化
            MefConfig.Init();

            //数据库初始化连接
            ConfigInit.InitConfig();

            //系统参数配置初始化
            ConfigManager configManager = MefConfig.TryResolve <ConfigManager>();

            configManager.Init();

            Console.Title         = SystemConfig.ProgramName;
            Console.CursorVisible = false; //隐藏光标

            //任务启动
            QuartzHelper.InitScheduler();
            QuartzHelper.StartScheduler();

            try
            {
                //启动站点
                using (NancyHost host = Startup.Start(SystemConfig.WebPort))
                {
                    //调用系统默认的浏览器
                    string url = string.Format("http://127.0.0.1:{0}", SystemConfig.WebPort);
                    //Process.Start(url);//自动弹出浏览器
                    Console.WriteLine("系统已启动,当前监听站点地址:{0}", url);
                    hideConsole("TaskScheduler-任务执行容器");
                    while (true)
                    {
                        Console.ReadLine();
                        Console.WriteLine("程序运行中,请勿输入任何内容!");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.ReadLine();
        }
示例#9
0
 public override void ExcuteTask()
 {
     base.ExcuteTask();
     try
     {
         QuartzHelper.StartScheduler();
     }
     catch (Exception ex)
     {
         JobExecutionException e2 = new JobExecutionException(ex);
         Log.Info("测试任务异常", ex);
         //1.立即重新执行任务
         e2.RefireImmediately = true;
         //2 立即停止所有相关这个任务的触发器
         //e2.UnscheduleAllTriggers=true;
     }
 }
示例#10
0
        protected override void OnStart(string[] args)
        {
            AppDomain.MonitoringIsEnabled = true;

            AdminRun.Run();

            DebuggableAttribute att = System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttribute <DebuggableAttribute>();

            if (att.IsJITTrackingEnabled)
            {
                //Debug模式才让线程停止10s,方便附加到进程调试
                Thread.Sleep(10000);
            }
            if (!SetConsoleCtrlHandler(cancelHandler, true))
            {
                LogHelper.WriteLog("程序监听系统按键异常");
            }
            try
            {
                //1.MEF初始化
                MefConfig.Init();
                LogHelper.WriteLog("MEF初始化");

                //2.数据库初始化连接
                ConfigInit.InitConfig();
                LogHelper.WriteLog("数据库初始化连接");

                //3.系统参数配置初始化
                ConfigManager configManager = MefConfig.TryResolve <ConfigManager>();
                configManager.Init();
                LogHelper.WriteLog("系统参数配置初始化");

                //4.任务启动
                QuartzHelper.InitScheduler();
                QuartzHelper.StartScheduler();
                LogHelper.WriteLog("任务启动");

                //5.加载SQL信息到缓存中
                XmlCommandManager.LoadCommnads(SysConfig.XmlCommandFolder);
                LogHelper.WriteLog("加载SQL信息到缓存中");

                //测试dapper orm框架
                //DapperDemoService.Test();

                #region 控制台用死循环监听

                ////启动站点
                //using (NancyHost host = Startup.Start(SystemConfig.WebPort))
                //{
                //    //调用系统默认的浏览器
                //    string url = string.Format("http://127.0.0.1:{0}", 9059);
                //    Process.Start(url);
                //    LogHelper.WriteLog( string.Format("系统已启动,当前监听站点地址:{0}", url));

                //    //4.消息队列启动
                //    RabbitMQClient.InitClient();

                //    LogHelper.WriteLog("消息队列启动");

                //    ////5.系统命令初始化

                //    CommandHelp.Init();
                //    LogHelper.WriteLog("系统命令初始化");
                //}

                #endregion

                ///Window服务用线程池
                ThreadPool.QueueUserWorkItem((o) =>
                {
                    //启动站点
                    string url = string.Format("http://127.0.0.1:{0}", SysConfig.WebPort);
                    Startup.Start(SysConfig.WebPort);
                    LogHelper.WriteLog(string.Format("系统已启动,当前监听站点地址:{0}", url));

                    //4.消息队列启动
                    //RabbitMQClient.InitClient();
                    LogHelper.WriteLog("消息队列启动");
                });
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex.Message);
            }
        }