在c#里面使用配置文件,出现警告

“System.Configuration.ConfigurationSettings.AppSettings” 已过时“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings”


答:在项目中添加引用System.Configuration.dll才行,引用using System.Configuration;
将System.Configuration.ConfigurationSettings.AppSettings修改为System.Configuration.ConfigurationManager.AppSettings

你可能感兴趣的:(配置文件)