ASP.NET How to use WebConfigurationManager to get a section from a Specific configuration file?

I am trying to get sections from a specific .config file such as "my.config". WebConfigurationManager.OpenWebConfiguration can get web.config in a specific path. Perhaps WebConfigurationManager.OpenMappedWebConfiguration can achieve my goal.

Can anyone share the experience?

+3
source share
1 answer

I do not know about using the OpenMappedWebconfig function, but this is the way to do it with a simple utility class:

http://aspalliance.com/705

, , ConfigurationSection, , MyConfig.configkey. , , , :
http://www.4guysfromrolla.com/articles/032807-1.aspx

, :
http://www.beansoftware.com/asp.net-tutorials/multiple-config.aspx

,

: Aspalliance.com , , , :

- - http://www.codeproject.com/KB/files/custom_config_file_reader.aspx

Microsoft - http://msdn.microsoft.com/en-us/library/2tw134k3.aspx

+1

Source: https://habr.com/ru/post/1745423/


All Articles