c#读取配置文件。
ExeConfigurationFileMap map = new ExeConfigurationFileMap();
map.ExeConfigFilename = @"E:site.config"; ;
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
string connstr = config.ConnectionStrings.ConnectionStrings["connStr"].ConnectionString;
MessageBox.Show(connstr);
string key = config.AppSettings.Settings["key"].Value;
MessageBox.Show(key);