static void Main() { LW.InitLog(); if (!XConfig.LoadConfig("XConfig.conf")) { LW.E("Config File Not Loaded!"); return; } DatabaseCore.InitialiseDBConnection(); DatabaseSocketsServer.InitialiseSockets(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainForm = new MainForm(); try { Application.Run(mainForm); } catch (Exception ex) { LW.E(ex.Message); LW.E("MainForm disappeared caused by exception!"); Thread.Sleep(1000); LW.E("DBServer is to be restarted to keep stability!"); } Application.Restart(); }
static void Main(string[] args) { LW.InitLog(); LW.SetLogLevel(LogLevel.Dbg); DataBaseOperation.InitialiseClient(); LW.D(DataBaseOperation.QuerySingleData(new DBQuery().WhereEqualTo("realname", "刘浩宇"), out UserObject me)); LW.D(me); ClassObject co = new ClassObject() { CDepartment = "学部", CGrade = "1年级", CNumber = "5班", TeacherID = me.ObjectId }; LW.D(DataBaseOperation.CreateData(ref co)); me.ClassList.Add(co.ObjectId); LW.D(co); SchoolBusObject bo = new SchoolBusObject() { BusName = "校车方向1", TeacherID = me.ObjectId }; LW.D(DataBaseOperation.CreateData(ref bo)); LW.D(bo); for (int cn = 1; cn < 40; cn++) { StudentObject stu = new StudentObject() { BusID = bo.ObjectId, ClassID = co.ObjectId, Sex = "M", StudentName = "学生-" + cn.ToString("000"), AHChecked = false, CSChecked = false, LSChecked = false }; LW.D(DataBaseOperation.CreateData(ref stu)); LW.D(stu); if (cn < 21) { me.ChildList.Add(stu.ObjectId); } } me.HeadImagePath = "liuhaoyu.gif"; LW.D(DataBaseOperation.UpdateData(ref me)); LW.D(me); }
public static void Main() { LW.SetLogLevel(LogLevel.Dbg); LW.InitLog(); LW.D("========= = Start WoodenBench for Schoolbus Windows Client = ========="); if (!XConfig.LoadConfig("XConfig.conf")) { LW.E("Config Loading Failed! Check file..."); return; } DataBaseOperation.InitialiseClient(); Application.EnableVisualStyles(); Application.Run(LoginWindow.Default); }
public static void Main(string[] args) { LW.SetLogLevel(LogLevel.Dbg); LW.InitLog(); var v = XConfig.LoadAll(); if (!(v.Item1 && v.Item2)) { return; } new Thread(new ThreadStart(GetStateString)).Start(); BuildWebHost(args).Run(); }
public static int Main(string[] args) { LW.SetLogLevel(LogLevel.D); LW.InitLog(); LW.I("========= = Start WoodenBench for Schoolbus Windows Client = ========="); if (!XConfig.LoadConfig("XConfig.conf")) { LW.E("Config Loading Failed! Check file..."); return(0); } DataBaseOperation.InitialiseClient(); Application.EnableVisualStyles(); Application.Run(LoginWindow.Default); DatabaseSocketsClient.KillConnection(); return(0); }
public static void Main(string[] args) { LW.SetLogLevel(LogLevel.Dbg); LW.InitLog(); StartUpTime = DateTime.Now; LW.D("WoodenBench WebServer Starting...."); LW.D($"\t Startup Time {StartUpTime.ToString()}."); Version = new FileInfo(new string(Assembly.GetExecutingAssembly().CodeBase.Skip(8).ToArray())).LastWriteTime.ToString(); LW.D($"\t Version {Version}"); var v = XConfig.LoadAll(); if (!(v.Item1 && v.Item2)) { return; } StatusMonitor.StartMonitorThread(); WeChatHelper.ReNewWCCodes(); DataBaseOperation.InitialiseClient(); //DataBaseOperation.InitialiseClient(IPAddress.Loopback); WeChatHelper.InitialiseExcryptor(); LW.D("Initialising Core Messaging Systems....."); WeChatMessageSystem.StartProcessThreads(); WeChatMessageBackupService.StartBackupThread(); MessagingSystem.StartProcessThread(); var webHost = BuildWebHost(XConfig.Current.ApplicationInsightInstrumentationKey, args); LW.D("Starting WebHost...."); WebServerTask = webHost.RunAsync(ServerStopToken.Token); WebServerTask.Wait(); LW.E("WebServer Stoped! Cancellation Token = " + ServerStopToken.IsCancellationRequested); }