ExeConfigurationFileMap map = new ExeConfigurationFileMap(); map.ExeConfigFilename = "SomeApp.config"; Configuration libConfig = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None); string strValue = libConfig.AppSettings.Settings["somekey"].Value;
时间: 2024-11-09 02:18:17