What's the difference between the WebConfigurationManager and the ConfigurationManager?

前端 未结 4 1651
臣服心动
臣服心动 2020-11-27 03:32

What\'s the difference between the WebConfigurationManager and the ConfigurationManager?

When should I use one over the other?

4条回答
  •  无人及你
    2020-11-27 03:53

    Not sure what you mean about the connection strings.

    Calling WebConfigurationManager.ConnectionStrings returns a System.Configuration.ConnectionStringSettingsCollection, which is the same as you would get if you called ConfigurationManager.ConnectionStrings.

    Otherwise, as XOR says, it's designed to handle multiple hierarchical web.configs, combining them as required as you move around the folders in an application.

提交回复
热议问题