static int Main(string[] args) { string message = string.Empty; _SystemConfig = new CSystemConfig(); if (_SystemConfig.getErrorCode() != 0) { return(1); } E_ERROR_CODE errorCode = loadConfigData(); if (errorCode != E_ERROR_CODE.OK) { return((int)errorCode); } _DbConnection = new CDbConnection(_DbConnectStr, _SystemLog); if (!_DbConnection.testConnect()) { _SystemLog.disposeLogWriter(); return((int)E_ERROR_CODE.ERROR_CONNECT_DB_FAILED); } initLocalVaribles(); while (true) { _BeiDouDeviceManager.processBeiDevice(); message = string.Format("Run cycle <{0}>, Next run time <{1}>....", _RequestCycle, CPublic.getDateTimeString(DateTime.Now.AddSeconds(_RequestCycle))); _SystemLog.writeLog(LOG_LEVEL.WARNING, message); Thread.Sleep(TimeSpan.FromSeconds(_RequestCycle)); } }
public CNetProxy(CSystemLog systemLog, CSystemConfig systemConfig) { _SystemLog = systemLog; _SystemConfig = systemConfig; _DbConnection = new CDbConnection(_SystemConfig.getConfigItem("DB_MYSQL_CONNECT_STR").ToString(), _SystemLog); Id = Guid.NewGuid().ToString().ToUpper(); }