我写了一个class,
实现了IConfigurationSectionHandler,
就OK了,
为什么系统内置的就不好用呢?
:(
实现了IConfigurationSectionHandler,
就OK了,
为什么系统内置的就不好用呢?
:(
解决方案 »
- 排序问题???
- 如何通过repeater1里面的a标签查询repeater2里面的值
- 如何控制用户两次发帖时间间隔在30秒以上。
- “/”应用程序中的服务器错误。
- 关于截取字符串长度的问题
- 这句话对吗?
- 关于新闻系统生成静态页的显示问题
- 怎样在插入一条记录的同时,立即返回刚插入如记录的ID值
- ASP.NET SQL语句问题
- 如何控制 下面的代码什么时间执行,为什么 页面运行就执行它了呢 load都没有执行!!!
- 错误:需要一个可更新的查询。我怎么找也找不到错在哪?
- string ss = (string)DataBinder.Eval(e.Item.DataItem, "SecID");有错吗?
1.配置节中type的
指定从配置文件中读取节的配置节处理程序类的名称,也就是说
MyConfigurationReader类 必须改成SingleTagSectionHandler而且命名空间必须是System.Configuration。
2.SingleTagSectionHandler必须实现IConfigurationSectionHandler接口。
using System;
using System.Collections;
using System.Configuration;
using System.Xml;
using System.Collections.Specialized;
namespace ServiceSales.ClassLib
{
/// <summary>
/// CConfig 的摘要说明。
/// </summary>
public class CConfig : IConfigurationSectionHandler
{
public Object Create(Object parent, object configContext, XmlNode section)
{
NameValueCollection settings;
try
{
NameValueSectionHandler baseHandler = new NameValueSectionHandler();
settings = (NameValueCollection)baseHandler.Create(parent, configContext, section);
}
catch
{
settings = null;
}
return settings;
}
}
}