public MySQL_Connection(MasterThread pMasterThread, string pUsername, string pPassword, string pDatabase, string pHost, ushort pPort = 3306) { if (pMasterThread == null) { throw new Exception("MasterThread shouldn't be NULL at this time!"); } _logFile = new Common.Logfile("Database", true, Path.Combine("Logs", pMasterThread.ServerName, "Database")); Stop = false; _connectionString = "Server=" + pHost + "; Port=" + pPort + "; Database=" + pDatabase + "; Uid=" + pUsername + "; Pwd=" + pPassword; Connect(); }
static void Main(string[] args) { if (args.Length != 1) { MessageBox.Show("Invalid argument length."); return; } log4net.GlobalContext.Properties["ImgName"] = args[0]; XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(Environment.CurrentDirectory, "..", "DataSvr", "logging-config-shop.xml"))); IMGFilename = args[0]; LogFile = new Common.Logfile(IMGFilename); UnhandledExceptionHandler.Set(args, IMGFilename, LogFile); MasterThread.Load(IMGFilename); Pinger.Init(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(MainForm = new frmMain()); }