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

[导入]<configSections> 的 <remove> 元素移除预定义的节或节组。

移除预定义的节或节组。

<configuration>
   <configSections>
      <remove>

<remove name="section name or section group name" />

必选属性

属性 说明
name 指定要移除的节或节组的名称。

备注

可使用 <remove> 元素从应用程序中移除在配置文件层次结构的更高级别定义的节和节组。

示例

下面的示例说明如何在应用程序配置文件中使用 <remove> 元素移除先前在计算机配置文件中定义的节。

以下计算机配置文件代码声明 <sampleSection> 这一节。

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

下面的应用程序配置文件代码移除 <sampleSection> 节。移除之后,应用程序将无法检索 <sampleSection> 中的设置。

<!-- Application configuration file. -->
<configuration>
   <configSections>
      <remove name="sampleSection"/>
   </configSections>
</configuration>

配置文件

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


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