RSS订阅优然探索
你的位置:首页 » 程序语言 » 正文

更新Web.config

选择字号: 超大 标准 发布时间:2009-11-29 23:18:10 | 作者:admin | 0个评论 | 人浏览

private void UpdateConfig(string KeyName, string Xvalue)
        {
            XmlDocument doc = new XmlDocument();
            string sPath = Server.MapPath("web.config");
            doc.Load(sPath);
            XmlNode node = doc.SelectSingleNode(@"//add[@key='" + KeyName + "']");
            XmlElement ele = (XmlElement)node;
            ele.SetAttribute("value", Xvalue);
            doc.Save(sPath);
        }

标签:更新Web.config  

猜你喜欢

发表评论

必填

选填

选填

必填,不填不让过哦,嘻嘻。

记住我,下次回复时不用重新输入个人信息

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。