Esempio n. 1
0
 public void Start()
 {
     //配置信息读取
     ConfigInit.InitConfig();
     QuartzHelper.InitScheduler();
     QuartzHelper.StartScheduler();
 }
Esempio n. 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.InitConfig();
            //3.系统参数配置初始化
            MefConfig.Init();
            ConfigManager configManager = MefConfig.TryResolve <ConfigManager>();

            configManager.Init();

            QuartzHelper.InitScheduler();
            QuartzHelper.StartScheduler();

            // 保持web服务运行
            ThreadPool.QueueUserWorkItem((o) =>
            {
                //启动站点
                Startup.Start(SystemConfig.WebPort);
            });
        }
Esempio n. 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();
        }
Esempio n. 4
0
 static void Main(string[] args)
 {
     ConfigInit.InitConfig();
     //ParseExpressCode();
     //ExpressUtil.HandleProecssInfo(ExpressUtil.GetCorrectIP(""));
     //MessageHelper.SendMessage(new Guid("6282AA73-2A58-E511-8D70-00155D0C740D"));
     //new Mysoft.Task.TaskSet.SendMessageJob().Execute(null);
 }
Esempio n. 5
0
 protected void Application_Start()
 {
     // 配置信息读取
     ConfigInit.InitConfig();
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     // 获取远程任务服务器上的 Scheduler
     QuartzHelper.InitRemoteScheduler();
 }
Esempio n. 6
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();
        }
Esempio n. 7
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ConfigInit.InitConfig();

            // 获取远程任务服务器上的 Scheduler
            QuartzHelper.InitRemoteScheduler();
        }
Esempio n. 8
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="env"></param>
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(AppContext.BaseDirectory)
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                          .AddJsonFile($"ocelot.json", optional: false, reloadOnChange: true)
                          .AddEnvironmentVariables();

            configuration = builder.Build().EnableTemplateSupport();
            configuration.GetReloadToken().RegisterChangeCallback(OnSettingChanged, configuration);
            ConfigInit.InitConfig(configuration);
        }
 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();
 }
Esempio n. 10
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);
            }
        }
Esempio n. 11
0
 static void Main(string[] args)
 {
     ConfigInit.InitConfig();
     strConnect = SysConfig.SqlConnect;
     MakeEntityUtil();
     //ParseExpressCode();
     //ExpressUtil.HandleProecssInfo("");
     //MessageHelper.SendMessage(new Guid("6282AA73-2A58-E511-8D70-00155D0C740D"));
     new Mysoft.Task.TaskSet.SendSmsJob().Execute(null);
     //new Mysoft.Task.TaskSet.SplitPhoneJob().Execute(null);
     //new Mysoft.Task.TaskSet.ReviewSms().Execute(null);
     Console.WriteLine("操作完成===");
     Console.Read();
 }
Esempio n. 12
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="env"></param>
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(env.ContentRootPath)
                          //.SetBasePath(AppContext.BaseDirectory)
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                          .AddEnvironmentVariables();

            Configuration = builder.Build();
            ConfigInit.InitConfig(Configuration);
            EFInitializer.UnSafeInit();
            XmlCommandManager.UnSafeInit();
        }
Esempio n. 13
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();
        }
Esempio n. 14
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);
            }
        }
Esempio n. 15
0
 /// <summary>
 /// 配置文件改变
 /// </summary>
 /// <param name="state"></param>
 private void OnSettingChanged(object state)
 {
     ConfigInit.InitConfig(state as IConfiguration);
 }