how to get xml content and edit xml file by using C#
I have an XML file called Emails.xml:
<Root> <Emails> <address>email@example.com</address> </Emails> <Emails> <address>adsfZSdf@.com</address> </Emails> </Root>
Um...I'm using visual studio, asp.net. I want to get the addresses by using C# code and also edit one or more addresses(e.g. chage "firstname.lastname@example.org" to "email@example.com"). Furthermore, add new address(es) to this xml file. (path of xml file is: C:\Documents and Settings\Administrator\Desktop\Emails.xml)
How can I do that?
Use the XmlDocument class. Then you can filter to the addresses with a call to GetElementsByTagName(string). From there, modification should be easy.