编译项目时,出现这样的警告:
“System.Configuration.ConfigurationSettings.AppSettings” 已过时“This method is obsolete, it
has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings”
解决方法:
(1)在项目中添加引用System.Configuration.
在项目“引用”右键 --->“添加引用” ---> .net选项卡中选择System.Configuration ---> 点击“确定”
(2)引入命名空间:
using System.Configuration;
(3) public static string connectionString = System.Configuration.ConfigurationManager.AppSettings["XXXXX"].ToString();
System.Configuration.ConfigurationSettings.AppSettings修改为System.Configuration.ConfigurationManager.AppSettings
重新编译,问题解决,哈哈!希望你也能成功!