Chinaunix首页 | 论坛 | 博客
  • 博客访问: 361644
  • 博文数量: 71
  • 博客积分: 4691
  • 博客等级: 上校
  • 技术积分: 935
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-14 15:14
个人简介

who am i ... i'm back.

文章分类

全部博文(71)

文章存档

2014年(4)

2011年(1)

2010年(22)

2009年(17)

2008年(27)

我的朋友

分类: 系统运维

2009-10-23 15:28:56

1.自定义section 的现有 类


System.Configuration.SingleTagSectionHandler、 System.Configuration.DictionarySectionHandler、 System.Configuration.NameValueSectionHandler

获取section定义的类:

ConfigurationManager.GetSection("xxx");

不同的section get的类型:

SingleTagSectionHandler  -》 Systems.Collections.IDictionary
 
DictionarySectionHandler -》  Systems.Collections.IDictionary
 
NameValueSectionHandler-》 Systems.Collections.Specialized.NameValueCollection

section 使用:

NameValueCollection nvc = (NameValueCollection)ConfigurationManager.GetSection("xxx");
 
nvc.GetValues("xxx")

2.自定义section 的自实现类
实现 ConfigurationSection --》section 类
    ConfigurationElement  --》 section下的 element(xmlnode)
    ConfigurationElementCollection  -》集合

阅读(889) | 评论(0) | 转发(0) |
0

上一篇:sybase 问题

下一篇:web.config 的 configSource

给主人留下些什么吧!~~