使用ConfigurationManager.GetSection()来实现类的方法
2012-10-31 23:16
441 查看
由于ConfigurationManager.GetSection()返回的object类型,可以在配置节点写上类名,如
<configSections>
<!--读取权限配置节点-->
<section name="Permission" type="FrameWork.PermissionConfigLoad"/>
</configSections>
通过调用ConfigurationManager.GetSection("Permission"),然后该类实现接口 public class PermissionConfigLoad : IConfigurationSectionHandler
{
/// <summary>
/// 实现IConfigurationSectionHandler接口Create方法
/// </summary>
/// <param name="parent"></param>
/// <param name="configContext"></param>
/// <param name="section"></param>
/// <returns></returns>
public object Create(Object parent, Object configContext, System.Xml.XmlNode section)
{
}
}
<configSections>
<!--读取权限配置节点-->
<section name="Permission" type="FrameWork.PermissionConfigLoad"/>
</configSections>
通过调用ConfigurationManager.GetSection("Permission"),然后该类实现接口 public class PermissionConfigLoad : IConfigurationSectionHandler
{
/// <summary>
/// 实现IConfigurationSectionHandler接口Create方法
/// </summary>
/// <param name="parent"></param>
/// <param name="configContext"></param>
/// <param name="section"></param>
/// <returns></returns>
public object Create(Object parent, Object configContext, System.Xml.XmlNode section)
{
}
}
相关文章推荐
- ConfigurationManager.GetSection()方法的使用
- ConfigurationManager.GetSection()方法的使用
- 关于ConfigurationManager.GetSection()方法
- PHP中使用cURL实现Get和Post请求的方法
- PHP使用方法重载实现动态创建属性的get和set方法
- 在PHP中使用CURL实现GET和POST请求的方法
- 配置文件刷新ConfigurationManager.RefreshSection使用问题
- Qt通过QNetworkAccessManager实现Http get方法文件下载
- PHP中使用CURL实现GET和POST请求的方法
- react使用hashHistory实现类似get方法带参数跳转
- JAVA:使用HTTP的get()方法来实现网络数据的读取
- PHP使用方法重载实现动态创建属性的get和set方法
- PHP中使用cURL实现Get和Post请求的方法
- configurationmanager.getsection usage example.
- 在PHP中使用CURL实现GET和POST请求的方法
- Div使用name属性实现通过getElementsByName获取Div集的方法
- iOS使用GCDSocketManager实现长连接的方法
- PHP中使用CURL实现GET和POST请求的方法
- 如何使用libcurl实现HTTP的GET方法获取文件长度
- 微信的API都是通过https调用实现的,分为post方法调用和get方法调用。不需要上传数据的采用get方法(使用IntraWeb开发)