static void Main() { LoggerBuilder.Init(LogTemplate.GetLogTemp(ConfigSystem.ReadConfig("Config", "Log", "Path"))).Set("Server").Info("Server Program Start"); FactoryDao.CreateInstance(ConfigSystem.ReadConfig("Config", "DB", "Connection"), ConfigSystem.ReadConfig("Config", "Log", "Path")); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); }
static void Main(string[] args) { Logger logger = null; try { if (Debug.IsDebug()) { args = new String[] { Debug.GetDebugKey(), Debug.GetDebugParam() }; } if (args.Length != 2) { throw new ScraperException("Parameter Length Error " + args.Length); } logger = LoggerBuilder.Init(LogTemplate.GetLogTemp(ConfigSystem.ReadConfig("Config", "Log", "WritePath") + "\\" + args[0] + ".log")).Set("Server").Info("Client Program Start"); logger.Debug("arg[0] : " + args[0]); logger.Debug("arg[1] : " + args[1]); FactoryDao.CreateInstance(ConfigSystem.ReadConfig("Config", "DB", "Connection"), ConfigSystem.ReadConfig("Config", "Temp", "Path")); IScrapingStatusDao dao = FactoryDao.GetInstance().GetDao <IScrapingStatusDao>(); if (!Debug.IsDebug()) { ScrapingStatus entity = dao.GetEntity(args[0]); if (entity == null) { throw new ScraperException("Nothing entity " + args[0]); } if (entity.Status != "0") { throw new ScraperException("entity status" + args[0]); } entity.Status = "1"; dao.Update(entity); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new ScraperContext(args[0], args[1])); } catch (Exception e) { if (logger != null) { logger.Error(e.ToString()); } Exit(); } }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); XmlConfigurator.Configure(); ILog logger = LogManager.GetLogger("ApplicationStart"); logger.Info("Started up this program."); FactoryDao.CreateInstance(System.Configuration.ConfigurationManager.ConnectionStrings["householdConn"].ConnectionString); FactoryMaster.Instance(); }
protected void Application_Start() { FactoryDao.CreateInstance(System.Configuration.ConfigurationManager.ConnectionStrings["conn"].ConnectionString); AisSocketServices.GetInstance().Run(); }