我收到以下警告
'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: '"This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings"'
如何解决?
最佳答案
添加对程序集 System.Configuration
的引用。
然后在顶部(假设使用 C#)使用 System.Configuration(在 VB.NET 中导入 System.Configuration)。
使用 ConfigurationManager.AppSettings["MySetting"]
访问设置!
关于c# - 'System.Configuration.ConfigurationSettings.AppSettings' 已过时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3959605/