473,770 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1361
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.SetAttribu tes(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
4326
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 TS is in ReadOnly mode. - Oracle will not recover ReadOnly TS during Oracle startup.
3
5180
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 (should be) RW. However, when trying to execute an Insert (or Update) query, it raises an error 'table is readonly'. How to solve this problem?
4
11313
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? alert(top.document.forms.actreqto.readonly); displays 'undefined'
2
4189
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) meaning Language) has been brought in. This value can only have one of two values : N (for Nederlands - Dutch) and E (for English) If a language in the excel has not been put in, the prog displays a warning. After clicking the OK button of the...
3
7123
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: 90%" name="Summary" rows="25" runat="server" / Depending on the circumstance the user can sometimes edit the contents and at other time they cannot. There is a readonly parameter I can use at definition time <TextArea id="Summary"...
10
7878
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 method. How ever, when I am debugging, that method is not being called. So I am not able to figure out, whether the field is getting initialized properly or not. Please explain this behavior Thanks in advance
11
1407
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 want to give them values in constructors in different classes in different files. What's the best way to accomplish this functionality? John Dalberg
0
979
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 setup with a Hot Key combination? Thanks, Lausivcip
3
4111
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 is not Set as ReadOnly. I have done this by opening file using FileStream Object opening in Edit mode with No Shared. But if I am try to apply same logic for ReadOnly files, then it throws NonAuthorized exception. This exception is also raised...
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10254
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.