【发布时间】:2009-09-01 07:42:23
【问题描述】:
除非我做错了什么,否则我应该使用 ConfigurationSection、ConfigurationElement 和 ConfigurationElementCollection 的方式需要我像这样格式化我的配置部分:
<serviceAuthorization>
<credentials>
<login username="system" password="password" mode="include">
<services>
<service type="AxeFrog.Mobile.Service.Security.AuthenticationService, AxeFrog.Mobile.Service" />
<service type="AxeFrog.Mobile.Service.Security.AnotherService, AxeFrog.Mobile.Service" />
</services>
</login>
<login username="test" password="pass" mode="exclude" />
</credentials>
</serviceAuthorization>
如果我对格式有更多的发言权,我会更喜欢。我想这样格式化我的部分:
<serviceAuthorization>
<login username="system" password="password" mode="include">
<service type="AxeFrog.Mobile.Service.Security.AuthenticationService, AxeFrog.Mobile.Service" />
<service type="AxeFrog.Mobile.Service.Security.AnotherService, AxeFrog.Mobile.Service" />
</login>
<login username="test" password="pass" mode="exclude" />
</serviceAuthorization>
有没有办法获取配置部分的 XML 并自己阅读?
【问题讨论】:
标签: c# .net web-config configuration-files