[英]ConfigurationManager.GetSection() function
Can someone elaborate how this function works? 谁能详细说明这个功能是如何工作的? Does it load every time from disk or it caches it somewhere in memory etc?
它是每次从磁盘加载还是将其缓存在内存中的某个位置等? Thanks in advance.
提前致谢。
.NET caches this and invalidates when the web.config changes
.NET会缓存此问题,并在web.config更改时失效
Also when in doubt open the decompiled sources and look at the code, it not only will give you the answer but you will learn a lot.. 此外,如果有疑问打开反编译源并查看代码,它不仅会给你答案,但你会学到很多东西..
当应用程序运行时,整个配置将加载到内存中,每当您尝试访问时,都会从内存中检索所需的部分
Configuration is in memory, any external change in the disk config file would have to be reloaded (standalone apps) 配置在内存中,磁盘配置文件中的任何外部更改都必须重新加载(独立应用程序)
ConfigurationManager.RefreshSection(sectionName); [1]
[1] http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.refreshsection.aspx [1] http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.refreshsection.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.