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

前端 未结 4 1661
臣服心动
臣服心动 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 04:11

    WebConfigurationManager is made specifically for ASP.NET applications.

    WebConfigurationManager provides additional methods to load configuration files applicable to Web applications.

    ConfigurationManager provides also methods to load configuration files applicable to ".exe" applications.

    I’d suggest taking a look at WebConfigurationManager and see if it provides you with anything you simply cannot do with ConfigurationManager and use it instead, otherwise using ConfigurationManager will make it far easier to have your code be used seamlessly between web and desktop aps.

提交回复
热议问题