我如何更新xml文件中的选定节点 [英] How i can update selected node in xml file
本文介绍了我如何更新xml文件中的选定节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人
我想以Windows窗体更新xml文件中的选定节点
谢谢Advanced
Dear All
I want to update selected node in xml file in windows form
Thanks in advanced
推荐答案
如果需要的话,这是一种更新单个节点的方法:)
This is a way to update a single node, if this is what you need :)
XmlDocument doc = new XmlDocument();
doc.Load("yourPathOrStream");
doc.SelectSingleNode("//root//childNode//childOfChild").InnerText = "something";
doc.Save("filename");
这篇关于我如何更新xml文件中的选定节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文