473,387 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ReadOnly XML Files

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
Nov 19 '05 #1
2 1337
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Raed Sawalha" wrote:
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

Nov 19 '05 #2
further to curt's reply..
Precisely, following the command you will need

File.SetAttributes(path, FileAttributes.Normal);
"Raed Sawalha" wrote:
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

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Darshak Shah | last post by:
Hi, * Question background : My DB is in ArchiveLog mode. I have TS in ReadOnly mode. As i know, - Oracle allows to DROP table resides in ReadOnly TS (& other objects also) even though that...
3
by: Sjaakie Helderhorst | last post by:
Hi, I managed to get a Fedora install up and running. Apache+PHP4+MySql. Copied a database from online server (RedHat) to my own, set permissions (chown mysql, chmod 777 mysql) so all files are...
4
by: harry | last post by:
<input type="text" name="actreqto" maxlength="20" value="" onkeypress="changedDetails();" onchange="changedDetails();" readonly="readonly"> Any ideas why doesn't this work? ...
2
by: Ronny Sigo | last post by:
Hello all, As one of a few ways to let a user bring in data into my database I have made 3 excel files. Once the data are in the excel files my program checks if a required value (Taal (Dutch)...
3
by: Michael SL | last post by:
I have a text area in which I have a client side javascript to process a "onclick". Because it is client side, I used a HtmlTextArea <TextArea id="Summary" onmouseup="SumMouseUp()" style="WIDTH:...
10
by: sunil | last post by:
Hello, I am new to c# . I have some basic programming doubts. Please help me in clarifying these doubts. I want to initialize a static and readonly field with a value returned by a static...
11
by: John Dalberg | last post by:
I would like to declare variables that can't be modified (like readonly) however I want to declare them in a single class so I can always refer to the same class whenever code uses them. However I...
0
by: lausivcid | last post by:
Hi, My project include reading XML files, I would like to set ReadOnly via a Keyboard Hot Key combination on the test XML files when I open them in the IDE. Is there an IDE Command I can...
3
by: Mayur H Chauhan | last post by:
All, I am working on one product where we need to check for physical file is in use (if it is open by other application). What I found out is that I am able to trap for those files whose attribute...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.