473,320 Members | 2,180 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,320 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 7139
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.