XmlDocument的锁定和释放问题 我在程序的开始用XmlDocument加载了一个Xml文件,修改后保存.但是在程序的其他部分就不能修改该Xml文件,一修改就会报错:该Xml文件已经被另一个进程使用.请教是不是在第一次修改后要进行一些释放资源的操作,具体怎么实现?谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 XmlDocument doc=new XmlDocument(); XmlTextReader xmlRe=new XmlTextReader(Application.StartupPath+"\\IPXML.xml"); doc.Load(xmlRe); XmlNode root=doc.DocumentElement; root.RemoveChild(root.ChildNodes[dgIP.CurrentCell.RowNumber]); xmlRe.Close(); doc.Save(Application.StartupPath+"\\IPXML.xml");可以这样 问个问题,正则表达式的,应该很简单吧,我刚学正则。。。不太懂 没设置断点的情况下,如果知道当前程序的执行位置? C# pdf转换成图片 或 Bitmap类型 C#(c/s系统) 下拉菜单 使用COM编的Outlook插件,为何只能运行一次? 菜鸟求助 如何写一个可以竖排(从左到右)的记事本程序? 关于for循环的一个问题 7日下午5点广州到西安火车票一张转让(硬卧上铺) treeView中如何更改当前选择的节点? C#调用c++开发的dll中的函数问题 c#求救
XmlTextReader xmlRe=new XmlTextReader(Application.StartupPath+"\\IPXML.xml");
doc.Load(xmlRe);
XmlNode root=doc.DocumentElement;
root.RemoveChild(root.ChildNodes[dgIP.CurrentCell.RowNumber]);
xmlRe.Close();
doc.Save(Application.StartupPath+"\\IPXML.xml");可以这样