private bool InitConfigData() { bool retValue = false; string msg = string.Empty; retValue = dbHelperOra.TestConnection(ref msg); Console.WriteLine("测试数据库连接状态返回的结果:{0} 错误信息:{1}", retValue ? "成功" : "失败", msg); retValue = false; try { string SectionGroupName = "LuoBei"; configService = new ConfigService(); xmlService = new XmlService(); lesseeId = configService.getValue(SectionGroupName, "lesseeId"); string sqlCount = configService.getValue(SectionGroupName, "excuteSqlCount"); int.TryParse(sqlCount, out excuteSqlCount); string frequency = configService.getValue(SectionGroupName, "collectFrequency"); MailReceiver = ConfigurationManager.AppSettings["MailReceiver"].ToString(); string configUserName = configService.getValue(SectionGroupName, "UserName"); if (string.IsNullOrEmpty(configUserName)) { UserName = SectionGroupName + UserName; } else { UserName = configUserName; } if (frequency != "") { int.TryParse(frequency, out nFrequency); } ConnnectionUrl = configService.getValue(SectionGroupName, "ConnnectionUrl"); ConnnectionGroups = configService.getValue(SectionGroupName, "ConnnectionGroups"); isDebug = configService.getValue(SectionGroupName, "WriteToDB").ToUpper() == "TRUE" ? false : true; configGroup = configService.getConfigGroup(SectionGroupName); xmlNodes = configGroup.xmlNode.Split(new String[] { "|" }, StringSplitOptions.RemoveEmptyEntries); foreach (string xmlNode in xmlNodes) { List <ConfiguredTagData> tags = xmlService.getXmlTagConfig(configGroup.config, xmlNode); foreach (var item in tags) { tagList.Add(item); } } retValue = true; } catch (Exception ex) { Logger.Fatal("执行InitConfigData方法出错!" + ex.ToString()); } return(retValue); }