• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
内蒙古峰回路转armyfeng
博客园    首页    新随笔    联系   管理    订阅  订阅

[导入]SingleTagSectionHandler 的自定义元素

为使用 SingleTagSectionHandler 类的自定义配置节定义设置。

<configuration>
      <sectionName>

<sectionName
   key="value"
   key2="value2"/>

属性

属性由用户定义。

备注

<sectionName> 元素是由 <configSections> 元素中的 <section> 标记定义的自定义元素。调用 ConfigurationSettings.GetConfig 时,配置系统返回一个 System.Collections.IDictionary 对象。

示例

下面的示例声明一个称为 <sampleSection> 自定义元素,它包含由 SingleTagSectionHandler 类读取的设置。

<configuration>
   <configSections>
      <section name="sampleSection"
               type="System.Configuration.SingleTagSectionHandler" />
   </configSections>
   <sampleSection setting1="Value1" setting2="value two" 
                  setting3="third value" />
</configuration>

配置文件

此元素可用于应用程序目录级以外的应用程序配置文件、计算机配置文件 (Machine.config) 和 Web.config 文件中


文章来源:http://www.codeguru.cn/ShowThread.aspx?PostID=729
posted @ 2006-09-24 16:56  老冯  阅读(290)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3