Okada Okada

Okada Okada

  • NA
  • 19
  • 2.9k

How to append changes to XML file using C# [VS2015]

Jul 2 2018 4:13 AM
How to append changes to XML file using C# [VS2015]
  
My XML file is like this.
 
<userSettings>
<Calc.Properties.Settings>
<setting name="WindowTop" serializeAs="String">
<value>240</value>
</setting>
<setting name="TableBackground" serializeAs="String">
<value>Transparent</value>
</setting>
</Calc.Properties.Settings>
</userSettings>
 
I need to add one more child element and sub child element. How to do this ?
 
The final xml file should be like this.
 
<userSettings>
<Calc.Properties.Settings>
<setting name="WindowTop" serializeAs="String">
<value>240</value>
</setting>
<setting name="TableBackground" serializeAs="String">
<value>Transparent</value>
</setting>
<setting name="TableForeground" serializeAs="String">
<value>Opaque</value>
</setting>
</Calc.Properties.Settings>
</userSettings>

Answers (4)