473,505 Members | 13,925 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML file vs Windows Registry

Hi

I just have a quick question. One of our Windows based application
uses the registry for configuration type options and some other
things. I want to modify our application to move to use a XML file
instead of the registry. The other engineer argues that it is faster
and easier to manipulate the registry than File I/O operations with
the XML file.

I just wanted ask you guys what are the strengths and weaknesses with
using a XML file over the registry?

Thanks
Nov 12 '05 #1
3 3703
I generally prefer the XML file.
I have an custom config section handler in my asp.net app, derived from
Craig Andera's thing.
(see
http://integralpath.blogs.com/thinki...rializati.html)

It is simple and easy to get config data via XML Serialization.

I also have some apps that use ONLY the registry for config data. These are
usually self-configuring apps that require just the copy of the exe for
install. They store state info in HKCU\\Software\\whatever. I just don't
want the clutter of a file sitting in the filesystem.

The big drawback - the registry is harder for the end user to view and
manipulate than a simple XML file.
-Dino

"Danny" <fe***********@gmail.com> wrote in message
news:dc**************************@posting.google.c om...
Hi

I just have a quick question. One of our Windows based application
uses the registry for configuration type options and some other
things. I want to modify our application to move to use a XML file
instead of the registry. The other engineer argues that it is faster
and easier to manipulate the registry than File I/O operations with
the XML file.

I just wanted ask you guys what are the strengths and weaknesses with
using a XML file over the registry?

Thanks

Nov 12 '05 #2
Thanks Dino for the reply and URL link for the XML Serialization.

What about priviledges wouldn't that also be an advantage for using
XML over the registry? If my application wanted to write to the
registry wouldn't I have to elevate the privileges of my application
to write to the registry.

Danny
"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message news:<e0**************@TK2MSFTNGP15.phx.gbl>...
I generally prefer the XML file.
I have an custom config section handler in my asp.net app, derived from
Craig Andera's thing.
(see
http://integralpath.blogs.com/thinki...rializati.html)

It is simple and easy to get config data via XML Serialization.

I also have some apps that use ONLY the registry for config data. These are
usually self-configuring apps that require just the copy of the exe for
install. They store state info in HKCU\\Software\\whatever. I just don't
want the clutter of a file sitting in the filesystem.

The big drawback - the registry is harder for the end user to view and
manipulate than a simple XML file.
-Dino

"Danny" <fe***********@gmail.com> wrote in message
news:dc**************************@posting.google.c om...
Hi

I just have a quick question. One of our Windows based application
uses the registry for configuration type options and some other
things. I want to modify our application to move to use a XML file
instead of the registry. The other engineer argues that it is faster
and easier to manipulate the registry than File I/O operations with
the XML file.

I just wanted ask you guys what are the strengths and weaknesses with
using a XML file over the registry?

Thanks

Nov 12 '05 #3
"Danny" <fe***********@gmail.com> a écrit dans le message de news:
dc**************************@posting.google.com...
What about priviledges wouldn't that also be an advantage for using
XML over the registry? If my application wanted to write to the
registry wouldn't I have to elevate the privileges of my application
to write to the registry.


No, you don't need special privileges to write to the registry. You do need
the correct permissions on the key you want to write to, in the same way you
need write permission on a file you want to write to. Registry keys under
HKCU will normally be writable by the user (while HKLM will usually not be
modifiable by a normal user).

Among the advantages of storing config data in the registry, I can see:
* smaller application footprint (no need to load an XML parser)
* simpler validation (registry values are typed)
* fewer possibilities of data corruption (values are accessed atomically).
There are counter-arguments for all of these. I think that low-level stuff
(services, system-wide parameters) should use the registry, while
user-visible configuration is better stored in files under the profile
directory.

Nov 12 '05 #4

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

Similar topics

3
8370
by: Larry Maturo | last post by:
I'm not sure if this is the right group to post this to, but here goes. I need to find out the name of the print spool file for every job queued to a particular printer. I actually need to read a...
9
10858
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
5
11651
by: Alex Nitulescu | last post by:
Hi. I'm trying to make MSMQ work, so I go to Control Panel, Windows Components, I select MSMQ (Message Queuing Client Setup, actually) and about half-way through I get a nice message box saying ...
3
3150
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
5
3152
by: IcingDeath via DotNetMonster.com | last post by:
I am building this SQL Server database app in which i can store files. In order to display files I want to have the app show the associated icon for the extension of the file that is in the...
5
3779
by: mike | last post by:
Hi, I have been playing with VB.NET/C# for getting some general properties of a fileinfo object. However, FileInfo object does not seem to expose some of the basic properties like TYPE that used...
13
3300
by: James Reid | last post by:
I'm looking for the source code for a DOS command line c/c++ program that can change file associations. In other words it can cause any version of Windows to associate a particular .exe file with a...
5
3655
by: =?Utf-8?B?Qkw=?= | last post by:
Hello friends In c# 2005 I have written a function to access "font file name" by "Font name" and it is working fine in all the windows version other than vista, in vista it is throughing an...
6
5152
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
The same error messages full out the application event log. --- "The open procedure for service "ASP.NET" in DLL "C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll" failed. Performance...
0
7213
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
7098
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
7366
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...
1
7017
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
7471
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
4698
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...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
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 ...

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.