Пример #1
0
        protected void Application_Start()
        {
            MrCMSApp.RegisterAllApps();
            AreaRegistration.RegisterAllAreas(MrCMSKernel.Kernel);
            MrCMSRouteRegistration.Register(RouteTable.Routes);

            RegisterServices(MrCMSKernel.Kernel);
            MrCMSApp.RegisterAllServices(MrCMSKernel.Kernel);

            SetModelBinders();

            SetViewEngines();

            BundleRegistration.Register(MrCMSKernel.Kernel);

            ControllerBuilder.Current.SetControllerFactory(new MrCMSControllerFactory());

            GlobalFilters.Filters.Add(new HoneypotFilterAttribute());

            ModelMetadataProviders.Current = new MrCMSMetadataProvider(MrCMSKernel.Kernel);

            ImagePluginInstaller.Install();

            MiniProfiler.Settings.Results_Authorize      = MiniProfilerAuth.IsUserAllowedToSeeMiniProfilerUI;
            MiniProfiler.Settings.Results_List_Authorize = MiniProfilerAuth.IsUserAllowedToSeeMiniProfilerUI;

            StartTasksRunning();

            OnApplicationStart();
        }
Пример #2
0
        protected void Application_Start()
        {
            MrCMSApp.RegisterAllApps();
            AreaRegistration.RegisterAllAreas(MrCMSKernel.Kernel);
            MrCMSRouteRegistration.Register(RouteTable.Routes);

            RegisterServices(MrCMSKernel.Kernel);
            MrCMSApp.RegisterAllServices(MrCMSKernel.Kernel);

            LegacySettingMigrator.MigrateSettings(MrCMSKernel.Kernel);
            LegacyTemplateMigrator.MigrateTemplates(MrCMSKernel.Kernel);

            SetModelBinders();

            SetViewEngines();

            BundleRegistration.Register(MrCMSKernel.Kernel);

            ControllerBuilder.Current.SetControllerFactory(new MrCMSControllerFactory());

            GlobalFilters.Filters.Add(new HoneypotFilterAttribute());

            ModelMetadataProviders.Current = new MrCMSMetadataProvider(MrCMSKernel.Kernel);

            ImagePluginInstaller.Install();

            MiniProfiler.Settings.Results_Authorize      = MiniProfilerAuth.IsUserAllowedToSeeMiniProfilerUI;
            MiniProfiler.Settings.Results_List_Authorize = MiniProfilerAuth.IsUserAllowedToSeeMiniProfilerUI;


            OnApplicationStart();
            var webRootPath = Server.MapPath("~");
            var docPath     = Path.GetFullPath(Path.Combine(webRootPath, "../Count_Visited.txt"));

            //Kiểm tra nếu chưa tồn tại file thì tạo file Count_Visited.txt
            if (!File.Exists(docPath))
            {
                File.WriteAllText(docPath, "0");
            }
            Application["DaTruyCap"] = int.Parse(File.ReadAllText(docPath));
        }
Пример #3
0
        protected void Application_Start()
        {
            SetModelBinders();
            SetViewEngines();

            MrCMSApp.RegisterAllApps();
            AreaRegistration.RegisterAllAreas(MrCMSKernel.Kernel);
            MrCMSRouteRegistration.Register(RouteTable.Routes);

            RegisterServices(MrCMSKernel.Kernel);
            MrCMSApp.RegisterAllServices(MrCMSKernel.Kernel);

            LegacySettingMigrator.MigrateSettings(MrCMSKernel.Kernel);
            LegacyTemplateMigrator.MigrateTemplates(MrCMSKernel.Kernel);

            BundleRegistration.Register(MrCMSKernel.Kernel);

            ControllerBuilder.Current.SetControllerFactory(new MrCMSControllerFactory());

            FilterProviders.Providers.Insert(0, new GlobalFilterProvider(MrCMSKernel.Kernel,
                                                                         typeof(HoneypotFilter),
                                                                         typeof(GoogleRecaptchaFilter),
                                                                         typeof(DoNotCacheFilter)
                                                                         ));


            ModelMetadataProviders.Current = new MrCMSMetadataProvider(MrCMSKernel.Kernel);

            ImagePluginInstaller.Install();

            MiniProfiler.Settings.Results_Authorize      = MiniProfilerAuth.IsUserAllowedToSeeMiniProfilerUI;
            MiniProfiler.Settings.Results_List_Authorize = MiniProfilerAuth.IsUserAllowedToSeeMiniProfilerUI;


            OnApplicationStart();
        }