.net修改XML数据 <?xml version="1.0" encoding="utf-8"?><Rules> <Node 转换率="1" /></Rules>前台有个txtConversion和btnOK按钮,怎么修改啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 XElement root = XElement.Load("Data.xml");root.Element("Node ").ReplaceAttributes("转换率", "要替换的值"); XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("***.xml"); XmlNode root = xmldoc.SelectSingleNode("Rules"); ((XmlElement)root.SelectSingleNode("Node")).SetAttribute("转换率", "1"); xmldoc.Save("***.xml"); XmlDocument xmlDoc = getXml("test.xml"); XmlNodeList nodes = xmlDoc.SelectNodes("Rules//Node"); foreach (XmlNode node in nodes) { node.Attributes["转换率"].Value = "要替换的值"; } xmlDoc.Save("test.xml"); 这条sql语句该怎么写啊 c#中如何获得键盘扫描码 大家能推荐一本C#2005的好书吗? 调用OWC Spreadsheet控件的get_value方法后,内存不能释放 如下这段代码如何转换为c# 我一个界面有两个TextBox为什么不能同时绑定日期控件? 如何用非递归的方法遍历目录及其子目录??!!算法高手请进!! 用C#调用EXE程序,不知道参数名字 请问有没有学习C#的好书? 有关MDI窗体的问题!请帮忙! C# 如何退出 按钮事件? GridView 显示问题 超简单但是就不会
root.Element("Node ").ReplaceAttributes("转换率", "要替换的值");
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("***.xml");
XmlNode root = xmldoc.SelectSingleNode("Rules"); ((XmlElement)root.SelectSingleNode("Node")).SetAttribute("转换率", "1");
xmldoc.Save("***.xml");
XmlNodeList nodes = xmlDoc.SelectNodes("Rules//Node");
foreach (XmlNode node in nodes)
{
node.Attributes["转换率"].Value = "要替换的值";
}
xmlDoc.Save("test.xml");