ReadOnly XML Files

G

Guest

I'm reading XML files using XmlDocument, in some cases i have XML marked with
readonly, so when tried to write to them an Access Denied exception is
generated, is there a way to change the XML file state in order to
successfully write to it. or there are other ways to write to xml though it
is readonly?


regards
 
G

Guest

Where did you set it ReadOnly, at the file level?
If so, you may have to access the File Attributes and change the file from
ReadOnly. System.IO should get you to this.
 
G

Guest

further to curt's reply..
Precisely, following the command you will need

File.SetAttributes(path, FileAttributes.Normal);
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top