473,396 Members | 1,671 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.

Registry vs. ini-files

Hello all!

Iīm going to develop a windows smartclient and canīt find the information I
need. Where do I store user-settings like paths, background colour and so
on. Iīve read an article about the ups and downs of registry versus files
but i canīt find it now. Can someone please help me?

Thanks in advance!
/Bobby
Jul 19 '05 #1
2 7145
in my opinion, the registry should only be used when the
nature of the application absolutely requires it.

COM applications are an excellent example of this need. A
COM application allows other applications to use its COM
control through its class ID (clsid). This ID is easily
placed in the registry by the COM server application, and
easily retrieved by a COM client. Without a central data
repository like the registry, writing COM apps would be
that much harder - perhaps even impossible.

more details you can find at
http://www.crtimmonsinc.com/Frontend...DesktopDefault
..aspx?tabid=1015.

But the best way if you are using .NET is config files.
-----Original Message-----
Hello all!

Iīm going to develop a windows smartclient and canīt find the information Ineed. Where do I store user-settings like paths, background colour and soon. Iīve read an article about the ups and downs of registry versus filesbut i canīt find it now. Can someone please help me?

Thanks in advance!
/Bobby
.

Jul 19 '05 #2
Bob Olsson wrote:
Hello all!

Iīm going to develop a windows smartclient and canīt find the
information I need. Where do I store user-settings like paths,
background colour and so on. Iīve read an article about the ups and
downs of registry versus files but i canīt find it now. Can someone
please help me?

Thanks in advance!
/Bobby


Just to supplement the questions you have had so far. Microsoft is
discouraging developers from using the registry or INI files. The problem
with the registry is that it involves a separate 'registration' step (this
may be hidden: occuring when the app first starts), and the data resides in
a location other than the application directory. This means that if you move
the app to another machine the settings don't move with it. If you uninstall
the app, you have to remove the registry settings. INI files can be stored
in the app directory, but they are limited due to their format, XML is far
more flexible.

Config files are XML files in the app directory, so you can copy or delete
them. However, config files are read-only (the current version of the
framework does not have a class specifically to read them, although you can
use the XML classes). They should be treated in the same way as command line
switches, ie, the app does not write to the config file and even if it does,
the settings are not picked up by the app until it is restarted. (Contrast
that to the registry and INI files, where settings can be re-read).

Also, settings in the config file are per-app, they are not per-user as you
are requesting. One solution is to read/write an XML file in Isolated
Storage. On this page:
http://www.c-sharppro.com/features/2...200309rg_f.asp I
explain some code to do this. The downside of using isolated storage is that
the file is not stored in the app folder, so if you move the app or delete
it the isolated storage is not affected. (The location of the files used in
isolated storage is a little cryptic.)

Richard
--
my email ev******@zicf.bet is encrypted with ROT13 (www.rot13.org)
Jul 21 '05 #3

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

Similar topics

10
by: Ruby Tuesdays | last post by:
How do you tell Apache or PHP of what php.ini file to use, specifically? I manage to tell Apache/PHP where to find php.ini by defining an environment variable PHPRC to a specified directory where...
3
by: jeff | last post by:
I am developing in PHP on a Windows environment but deploying to a *nix flavor. I would like to use the extension recognition in Apache in my local environment for cgi, and have set the...
4
by: serge calderara | last post by:
Dear all, How can I access in VB.NET to a registry key on a local and remote computer. Does the previous Profile string function can be safelly used on is there anything else ? thnaks for...
2
by: fabrice | last post by:
hello, Is it possible to read a registry key in ASP, and use the value in an application via a session variable. I'm using II6 on windows server 2003. I'd like to create a key in the registry...
2
by: Carsten | last post by:
I need to make a system dsn connection on 50 pc. It's a system dsn connection with sql users I have though about to make a registry key, but I don't know where user and password are in the...
4
by: Alan Searle | last post by:
I would like to write values to the registry and am having problems with a very simple block of code. Here it is ... -------------------------------------------------------- Option Compare...
4
by: Ioannis Vranos | last post by:
In the past I had read that in .NET world there is no need to store data in the registry, but the applications would have some other independent way to do that. What is this way? Suppose we...
4
by: academic | last post by:
Does anyone know where in the registry the following goes? WriteProfileString("windows", "Device", DeviceLine) Or where this comes from? GetProfileString("PrinterPorts", vbNullString, "",...
0
by: Michael Fay in SB | last post by:
A month ago I posted: "I built my application with Access 2003 and made a distribution using the Microsoft Office Access 2003 Developer Extensions. (I also install Jet 8 as a follow-on action at...
6
by: dylan.boudreau | last post by:
My configuration is Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7d PHP/5.0.4 on Solaris 10. phpinfo() lists the location of php.ini as /usr/local/apache/conf and my php.ini file is there but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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.