cant modifiy xml file

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I use this method to modify an xml file...
but it`s not working:

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; bool ModifyXMl()
{
<span style="color:Blue; bool Result = <span style="color:Blue; false;
<span style="color:Blue; try
{
XmlDocument doc = <span style="color:Blue; new XmlDocument();
doc.Load(Properties.Settings.Default.XmlFilePath);
XPathNavigator nav = doc.CreateNavigator();
XmlNamespaceManager manager = <span style="color:Blue; new XmlNamespaceManager(nav.NameTable);
XPathNavigator caption = nav.SelectSingleNode(<span style="color:Blue; string.Format(<span style="color:#A31515; "UpdaterMessagesAr/Message[ID = {0}]/Caption", EncDec.Encrypt(textBox1.Text, Constant.Password)),manager);

XPathNavigator Desc = nav.SelectSingleNode(<span style="color:Blue; string.Format(<span style="color:#A31515; "UpdaterMessagesAr/Message[ID = {0}]/Description", EncDec.Encrypt(textBox1.Text, Constant.Password)),manager);
caption.SetValue(EncDec.Encrypt(textBox2.Text, Constant.Password));
Desc.SetValue(EncDec.Encrypt(textBox3.Text, Constant.Password));
Result = <span style="color:Blue; true;
}
<span style="color:Blue; catch (Exception ex)
{
Result = <span style="color:Blue; false;
}
<span style="color:Blue; return Result;
}
[/code]
<br/>
could you guyz help me?


View the full article
 
Back
Top