亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

實(shí)現(xiàn)IConfigurationSectionHandler接口來(lái)編寫(xiě)自

系統(tǒng) 1909 0
發(fā)表時(shí)間:2008-4-4 10:55:00

代碼如下:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Xml;


namespace Beyondbit.Portal.ConfigService {
??? public class TopMenuConfigItem {
??????? public string Text;
??????? public string Value;
??????? public string Url;
??????? public string Description;
??? }

??? public class TopMenuConfig : IConfigurationSectionHandler {

??????? private IList<TopMenuConfigItem> topMenus;
??????? public IList<TopMenuConfigItem> TopMenus {
??????????? get {
??????????????? return topMenus;
??????????? }
??????? }

??????? public static TopMenuConfig Instance() {
??????????? return ConfigurationManager.GetSection("TopMenuConfig") as TopMenuConfig;
??????? }

??????? #region IConfigurationSectionHandler Members

??????? object IConfigurationSectionHandler.Create(object parent, object configContext, XmlNode section) {
??????????? XmlNode node = section;
??????????? topMenus = new List<TopMenuConfigItem>(node.ChildNodes.Count);

??????????? TopMenuConfigItem m = null;
??????????? foreach (XmlNode n in node.ChildNodes) {
??????????????? if (n.NodeType != XmlNodeType.Comment) {
??????????????????? m = new TopMenuConfigItem();
??????????????????? m.Description = n.Attributes["Description"].Value;
??????????????????? m.Text = n.Attributes["Text"].Value;
??????????????????? m.Url = n.Attributes["Url"].Value;
??????????????????? m.Value = n.Attributes["Value"].Value;
??????????????????? topMenus.Add(m);
??????????????? }
??????????? }

??????????? return this;
??????? }

??????? #endregion
??? }
}


Web.config如下:
<?xml version="1.0"?>
<configuration>
?</configSections>
??? <section name="TopMenuConfig" type="Beyondbit.Portal.ConfigService.TopMenuConfig,Beyondbit.Portal.ConfigService" />
? </configSections>

<TopMenuConfig>
??? <topMenu Text=" 郵件 " Value="ExchangeMail" Url=" http://mail.pudong.sh/owa/?cmd=contents " Description="http://www.blog.com.cn/ 郵 件 " />
??? <topMenu Text=" 通訊錄 " Value="link" Url=" http://contact.pudong.sh/web/Contact/ContactMain.aspx " Description="http://www.blog.com.cn/通訊錄" />
??? <topMenu Text=" 共享日歷 " Value="calendar" Url=" http://calendar.pudong.sh/web/calendar/calendarmain.aspx " Description="http://www.blog.com.cn/共享日歷" />
??? <topMenu Text=" 短信息 " Value="sms" Url=" http://sms.pudong.sh/Web/User/SmsSend.aspx " Description="http://www.blog.com.cn/短信息" />
??? <topMenu Text=" 會(huì)議通知 " Value="meeting" Url=" http://meeting.pudong.sh/tasks/tasklist.aspx " Description="http://www.blog.com.cn/會(huì)議通知" />
? </TopMenuConfig>
? <appSettings />
?<system.web>
?</system.web>
</configuration>

實(shí)現(xiàn)IConfigurationSectionHandler接口來(lái)編寫(xiě)自定義配置


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 国产精品亚洲精品爽爽 | 人做人爱视频欧美在线观看 | 亚洲人xx视频 | 久久日韩 | 福利视频在线观看午夜 | 久久久久国产精品免费免费不卡 | 欧美成人精品一级高清片 | 国内精品久久久久尤物 | 久久久高清免费视频 | 欧美一级爱爱视频 | 色综合久久久久久 | 亚洲一级毛片在线观 | 精品久久国产视频 | aaa色 | 色久悠悠在线观看 | 99久久精品国产免看国产一区 | 成人免费观看网欧美片 | 欧美日韩在线播一区二区三区 | 色资源在线观看 | 四虎国产精品免费五月天 | 一区二区日本 | 四虎四虎 | 国人精品视频在线观看 | 在线视频一二三区2021不卡 | 色在线观看视频 | 久久久久久综合一区中文字幕 | 国产在线视频h | 99热精品久久只有精品30 | 久久香蕉国产 | 中文字幕亚洲欧美一区 | 91福利国产在线观看 | 九九黄色大片 | 欧美成a | 国产精品亚洲第五区在线 | 国内精品51视频在线观看 | 无遮挡无遮挡91桃色在线观看 | 亚色视频在线观看 | 国产色视频一区二区三区 | 一本色道久久综合亚洲精品高清 | 日本阿v精品视频在线观看 日本爱爱免费视频 | 人人干人人爱 |