古怪的ConfigurationManager类
生活随笔
收集整理的這篇文章主要介紹了
古怪的ConfigurationManager类
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
開始使用VS 2005,習慣性的使用ConfigurationSettings類來讀取應用程序配置文件的信息時,卻被編譯器提示說:警告 ?1?“System.Configuration.ConfigurationSettings.AppSettings”已過時:“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings”?
于 是轉而想找到那個ConfigurationManager類來使用,結果在System.Configuration命名空間下死活找不到 ConfigurationManager類,無奈,求助于網絡,才知道原來還要添加對System.Configuration.dll 文件的引用~~
事后才留意到,原來MS對這一點還是提示了一下的,只不過比較隱晦而已——
This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings
注意到沒有,上面這段話多了System.Configuration!這段?
于 是轉而想找到那個ConfigurationManager類來使用,結果在System.Configuration命名空間下死活找不到 ConfigurationManager類,無奈,求助于網絡,才知道原來還要添加對System.Configuration.dll 文件的引用~~
事后才留意到,原來MS對這一點還是提示了一下的,只不過比較隱晦而已——
This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings
注意到沒有,上面這段話多了System.Configuration!這段?
總結
以上是生活随笔為你收集整理的古怪的ConfigurationManager类的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 求花田错歌词!
- 下一篇: 黄山风景区晚上可以爬山吗