修改web.config
生活随笔
收集整理的這篇文章主要介紹了
修改web.config
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
讀取
View Code 1 ConfigurationManager.AppSettings["isMail"]?
修改
View Code 1 public static void SetValue(string path, string KeyName, string AppValue) 2 { 3 XmlDocument xDoc = new XmlDocument(); 4 xDoc.Load(path); 5 XmlNode xNode; 6 XmlElement xElem1; 7 xNode = xDoc.SelectSingleNode("//configuration");//固定查詢 AppSettings下節點 8 xElem1 = (XmlElement)xNode.SelectSingleNode("//add[@key='" + KeyName + "']"); 9 if (xElem1 != null) xElem1.SetAttribute("value", AppValue); 10 xDoc.Save(path); 11 }?
?
?
轉載于:https://www.cnblogs.com/wanghafan/archive/2012/05/10/2493972.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的修改web.config的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: git 提交修改到github上
- 下一篇: Swift云存储特性研究