472,334 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,334 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 6980
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...
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...
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...
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...
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...
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 ... ...
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...
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? ...
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....
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...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.