ReadOnly XML Files

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
further to curt's reply..
Precisely, following the command you will need

File.SetAttributes(path, FileAttributes.Normal);
 
Back
Top