IXMLDOMDocument.Save() does not work

B

Brian

I am trying to load an exisiting xml file and append a
node to it then save the xml file but the save method
fails. Here is the code:

IXMLDOMNode n;
n = thisXDocument.DOM.selectSingleNode
("my:root/wns:section");

object loadFilePath = "d:\\xml\\.xml";
IXMLDOMDocument newDOM = thisXDocument.CreateDOM();
newDOM.load(loadFilePath);

IXMLDOMNode no = newDOM.selectSingleNode
("base/Section");

no.appendChild(n);
newDOM.save(loadFilePath);


The error is:
System.UnauthorizedAccessException
Access is denied.

I granted full control to Everyone to the folder and the
file but I am still getting this error. Am I missing
something simple?
 
J

Josh Bertsch [MSFT]

Search for the "Save As" thread that was posted earlier in this newsgroup.
That should give you some answers.

--josh bertsch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top