方法1: 代码如下: System.Collections.Specialized.NameValueCollection nvc = (System.Collections.Specialized.NameValueCollection) System.Configuration.ConfigurationManager.GetSection(sectionName); string keyValue = nvc.GetValues(keyName)[0].ToString(); 方法2: 代码如下:System.Web.Configuration.WebConfigurationMa