第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

修改配置文件的問題

修改配置文件的問題

九州編程 2018-12-06 12:47:37
1:我在app.config文件里自定義了一個section <section name="Notify" type="Roboth.NotifySection,Roboth"/> <Notify>     <OrderStateTypes>    </OrderStateTypes> </Notify> 2:我想通過程序向OrderStateTypes添加<add id="1" status="2" ispaid="1" isdeleted="0" statusnotify="payment at full"></add> 3:code Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);            NotifySection section = (NotifySection)config.GetSection("Notify");            //string xmlfile = section.MsgTypes["OrderStateChanged"].Parameters["OrderStateTypeXmlPath"].ParamValue.ToString();            OrderStateTypeElement ost = new OrderStateTypeElement();            ost.IsDeleted = 1;            ost.IsPaid = 1;            ost.Status = 1;            ost.Name = "1";            ost.StatusNotify = "jj";            section.OrderStateTypes.Add(ost);            config.Save(); 我該如何實現(xiàn) 呢? 請大家指教
查看完整描述

3 回答

?
慕村225694

TA貢獻1880條經(jīng)驗 獲得超4個贊

XmlDocument doc = new XmlDocument(); doc.Load(configFilePath); XmlNode sectionNode = doc.SelectSingleNode("Notify/OrderStateTypes"); XmlNode newNode = doc.CreateElement("add"); XmlAttribute attId = doc.CreateAttribute("id"); attId.Value = youId; newNode.Attributes.Append(attId); ...append other attributes sectionNode.AppendChild(newNode); doc.Save(configFilePath);
查看完整回答
反對 回復 2019-01-21
  • 3 回答
  • 0 關注
  • 428 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號