Hello folks!
I have to read an XML file, add some elements and write it back.
I seem to have no problem doing the first 2 things but then I get
The process cannot access the file "c:/file.xml" because it is being used by
another process.
... when I try to do the third thing: saving.
This is how I am doing it:
XmlDocument oXml=new XmlDocument();
oXml.Load(new XmlTextReader(@"c:\file.xml"));
// do the element work here
oXml.Save(new XmlTextWriter(@"c:\file.xml", System.Text.Encoding.ASCII));
The error occurs right at the Save call.
Any of you more experienced folks ever tried to do anything like this?
Thanks!
--
Marco Rispoli - NJ, USA / PP-ASEL
My on-line aviation community -> http://www.thepilotlounge.com