1.在项目中引用System.Configuration.dll,在需要的页面加上using System.Configuration; 2.把ConfigurationSettings.AppSettings["字符串"]; 替换成ConfigurationManager.AppSettings["字符串"];