473,396 Members | 1,816 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,396 software developers and data experts.

c# - XML file - load xml, modify xml, save xml - HOW!!

Hi, if I load an XML file, then modify a value, then try to save it I get an exception, access denied error. I've tried everything - help please????

For example:

XmlReaderSettings settings = new XmlReaderSettings();
settings.CloseInput = true; // should close immediately now
XmlReader reader = XmlReader.Create(filename, settings);
XmlDocument doc = new XmlDocument();
doc.Load(reader);
reader.Close();

XmlNodeList list = doc.GetElementsByTagName("bookname");
list.Item(0).InnerText = "new name";

doc.Save(filename);


Many thanks...
Jun 28 '07 #1
0 4866

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Ingo Linkweiler | last post by:
Hello, I am looking for a 100% python lib/script which can load a jpg image, detect its size, resize and save it as new file. I have found some tools (like PIL), but all of them use ImageMagic...
2
by: Greg | last post by:
looking for an easy way for users to browse for a file on their local drive, and then have access automatically make a copy of that file (files will most likely be images) and save it under a new...
0
by: Marcelo López | last post by:
Anybody knows how can i modify the windows common dialog "Save as" to insert for example a button inside it ? Regards Marcelo López | .NET Developer | Departamento de Desarrollo | Infocorp |...
2
by: Tim Smith | last post by:
I have a program that I want to open a file and then save it as a different type (i.e. open a .txt file and save it as a RTF). How can I do this programatically?
5
by: Henry Wu | last post by:
Hi, I was wondering if I could save all of the controls in a tabcontrol for example, complete with the controls' name, text, value, position, size, etc.. Then when the user opens the application...
4
by: Satya | last post by:
I am trying to display a PDF file (which I am being passed from a web service as a binary stream) in a browser, but I am being prompted to save the file instead. I don't want the user to be...
3
by: mrsmith | last post by:
I'm trying to do a file load with this statement: LOAD FROM "/directory/datafile.txt" OF ASC MODIFIED BY NULLINDCHAR=Y METHOD L (1 8, 13 20, 28 30, 39 89) NULL INDICATORS (4, 7, 8,0) INSERT...
1
by: jdhavo | last post by:
I'm trying to download an image file using XML from a web service. When the dialog box appears asking if I want to save the document or open it, If I click save and then open it, it works fine. If...
2
by: Johannes Kiehl | last post by:
Hi, I want a PHP script to "wake up" as soon as a file in a directory has been modified (by some other script). The obvious solution that comes to mind would be a ( readdir, filectime, maybe...
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?
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
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,...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.