首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FCL支持直接访问configuration/configSections元素?

FCL支持直接访问configuration/configSections元素?
EN

Stack Overflow用户
提问于 2011-08-09 04:30:44
回答 1查看 46关注 0票数 1

除了解析类之外,是否有强类型的类或方法可以直接以编程方式访问configuration/configSections元素?

这是定义配置节和组的主要配置区域。我仔细阅读了System.Configuration.ConfigurationSection inheritance的MSDN文档,什么也没有弹出。

System.Configuration.ConfigurationManager类似乎只访问文件的解析版本,并且它似乎不提供对configuration/configSections本身的直接访问。

如果我必须使用XML类解析配置,我并不介意,但如果庞大的FCL还没有一个帮助器来完成这项任务,我会感到惊讶。

configSections部分的示例(也请参阅其中的我的注释):

代码语言:javascript
复制
<?xml version="1.0"?>

<configuration>

  <!-- This element is what I want to directly access programmatically -->
  <configSections>
    <section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler,dotless.Core" />
    <section name="zforms" type="ZForms.Config.ZFormsSection, ZFormsLib"/>
  </configSections>

<!-- I don't care about this -->
<zforms default="form2">
    <add name="form1" title="Reading" />
    <add name="form2" title="Assignment" />
</zforms>
EN

回答 1

Stack Overflow用户

发布于 2011-08-09 04:32:47

查看ConfigurationManager classGetSection method

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6988155

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档