C#类库读取App.config配置文件
private Configuration readAppConfig() { string configPath = @"E:\xxx\App.config"; Configuration config = ConfigurationManager.OpenMappedExeConfiguration( new ExeConfigurationFileMap() { ExeConfigFilename = configPath }, ConfigurationUserLevel.None); //MessageBox.Show(config.AppSettings.Settings["serverIp"].Value); return config; }
http://www.it1352.com/9531.html原文地址