博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
.net 2.0中ConfigurationManager替代了原来的ConfigurationSettings
阅读量:4073 次
发布时间:2019-05-25

本文共 564 字,大约阅读时间需要 1 分钟。

在1.1版本中,使用ConfigurationSettings类来读取配置文件(web/app.config),而在.net 2.0中,使用ConfigurationManager类来读取配置文件,具体用法:

return System.Configuration.ConfigurationSettings.AppSettings["UserID"];

改为

return System.Configuration.ConfigurationManager.AppSettings["UserID"];

 

看起来两者之间的区别不大,没有仔细去看,

来自官方的说法:

The advantage of using ConfigurationManager is , but briefly:

  1. Access sections other than appConfig, including connectionStrings, and your own custom sections
  2. Can read and write the configuration.
  3. It can have separate settings for the application and the users
  4. It’s extensible

微软链接:

转载地址:http://hggji.baihongyu.com/

你可能感兴趣的文章
OS + Linux DNS Server Bind
查看>>
linux下安装django
查看>>
Android 解决TextView设置文本和富文本SpannableString自动换行留空白问题
查看>>
最完整的Java IO流学习总结
查看>>
Android开发中Button按钮绑定监听器的方式完全解析
查看>>
Android自定义View实现商品评价星星评分控件
查看>>
postgresql监控工具pgstatspack的安装及使用
查看>>
postgresql查看表的和索引的情况,判断是否膨胀
查看>>
postgresql中根据oid和filenode去找表的物理文件的位置
查看>>
postgresql减少wal日志生成量的方法
查看>>
swift中单例的创建及销毁
查看>>
获取App Store中App的ipa包
查看>>
iOS 关于pods-frameworks.sh:permission denied报错的解决
查看>>
设置RGBColor
查看>>
设置tabbaritem的title的颜色及按钮图片
查看>>
动态设置label的高度
查看>>
获取 一个文件 在沙盒Library/Caches/ 目录下的路径
查看>>
图片压缩
查看>>
检测缓存文件是否超时
查看>>
十进制字符串转十六进制字符串
查看>>