public static void InitializeIniFiles() { string pathIni = AppDomain.CurrentDomain.BaseDirectory + "Config.ini"; if (!File.Exists(pathIni)) { CreateIniFile(pathIni); } else { _attConfigMBAgent = new WorkerIniConfiguration(pathIni); } }
public static void CreateIniFile(string strFileName) { _attConfigMBAgent = new WorkerIniConfiguration(strFileName); try { _attConfigMBAgent.IniWriteValue("FileLogConfiguration", "AutoAppend", "true"); _attConfigMBAgent.IniWriteValue("FileLogConfiguration", "BufferSize", "100"); _attConfigMBAgent.IniWriteValue("FileLogConfiguration", "FileName", Process.GetCurrentProcess().ProcessName); _attConfigMBAgent.IniWriteValue("FileLogConfiguration", "MaximumFiles", "0"); _attConfigMBAgent.IniWriteValue("FileLogConfiguration", "LogFileMaxSize", "10"); _attConfigMBAgent.IniWriteValue("FileLogConfiguration", "Level", "Error"); _attConfigMBAgent.IniWriteValue("FileLogConfiguration", "AutoSaveTimeOut", "10"); _attConfigMBAgent.IniWriteValue("WorkerConfiguration", "ReconnectionPeriod", "60"); _attConfigMBAgent.IniWriteValue("WorkerConfiguration", "ConsumePeriod", "1"); _attConfigMBAgent.IniWriteValue("WorkerConfiguration", "PublishPeriod", "1000"); } catch (Exception) { // ignored } }