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

實現IConfigurationSectionHandler接口來編寫自

系統 1654 0
發表時間: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=" 會議通知 " Value="meeting" Url=" http://meeting.pudong.sh/tasks/tasklist.aspx " Description="http://www.blog.com.cn/會議通知" />
? </TopMenuConfig>
? <appSettings />
?<system.web>
?</system.web>
</configuration>

實現IConfigurationSectionHandler接口來編寫自定義配置


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

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

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲欧美久久精品一区 | 色婷婷久久久swag精品 | 西西人体大胆77777视频 | 狠狠干艹| 日韩三级不卡 | 日韩一区二区三区不卡视频 | 久久香蕉国产线看观看亚洲卡 | 久久精品全国免费观看国产 | 日韩毛片最新看 | 久操视频在线播放 | 亚洲综色 | 亚洲欧美日韩高清专区一区 | 欧美精品久久久久久久免费观看 | 99精品这里只有精品高清视频 | 亚洲精品不卡久久久久久 | 久久久久久亚洲精品不卡 | 伊伊综合 | 久久久国产精品免费看 | 国产精品久久永久免费 | 亚洲综合久久久 | a在线观看视频 | 91视频香蕉 | 毛片网站大全 | 欧美精品成人久久网站 | 中文字幕亚洲综合精品一区 | 中文字幕亚洲 综合久久 | 亚洲激情视频在线播放 | 亚洲黄色小视频 | 亚洲一区二区三区不卡在线播放 | 牛牛色婷婷在线视频播放 | 91精品国产爱久久久久久 | 搜索一级毛片 | 奇米777视频二区中文字幕 | 日日拍夜夜嗷嗷叫狠狠 | 久久久久综合国产 | 久久免费香蕉视频 | 五月婷婷色综合 | 一区二区三区在线播放视频 | 国产亚洲美女精品久久久久狼 | 亚洲精国产一区二区三区 | 成人国产片免费 |