标签:des io ar for cti sp on new ad
<configuration>
<configSections> <section name="Tab" type="Test.Server.TabHandler,Test.Server"/> </configSections>
<Tab>
<add key="tab1" value="标题1"/>
<add key="tab2" value="标题2"/>
</Tab>
</configuration>
public class TabHandler : IConfigurationSectionHandler { public object Create(object parent, object configContext, System.Xml.XmlNode section) { var profileList = new List<TabModel>(); foreach (XmlNode xn in section.ChildNodes) { if (xn.Attributes == null) continue; profileList.Add(new TabModel
{
Key = xn.Attributes["key"] == null ? string.Empty : xn.Attributes["key"].Value,
Value = xn.Attributes["value"] == null ? string.Empty : xn.Attributes["value"].Value
});
}
return profileList;
}
}
private static List<TabModel> list = ConfigurationManager.GetSection("Tab") as List<TabModel>;
标签:des io ar for cti sp on new ad
原文地址:http://www.cnblogs.com/Rannie/p/3944269.html