110,571
社区成员
发帖
与我相关
我的任务
分享
MyXMLDoc.Save(Application .StartupPath + "\\yours.xml");
string ostr="1";
string nstr="111111";
XmlDocument MyXMLDoc = new XmlDocument();
MyXMLDoc.Load(Application .StartupPath + "\\yours.xml");
try
{
string myfindstring = "Computers/Setting [UseNum=" + '"' + ostr+ '"' + "]";
XmlNode MyNode = MyXMLDoc.SelectSingleNode(myfindstring);
if(MyNode!=null)
MyNode.InnerText=nstr;
}
catch(Exception ex)
{
MessageBox.Show(ex.message);
}