473,686 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!
Jul 19 '05 #1
2 7236
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
..aspx?tabid=10 15.

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!

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!

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.)

my email ev******@zicf.b et 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

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 there is a php.ini file. How do I tell Apache/PHP to use e.g c:\php\php4.ini or c:\php\php5.ini? Thanks
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 "ScriptInterpreterSource" value to "registry" in my Apache config. That said, I need the "#!" line in my scripts so when I upload them to their "live" directory, the server can find the php executable. When I try to run a script locally that has the...
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 your answer regards
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 (under HKLM) and store a value (connection string for example). In the ASP application, read the value and store it in a session variable with global.asa.
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 registry. My question is where in the registry can I find these keys?
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 Database Option Explicit Private Declare Function WriteProfileString _ Lib "kernel32" Alias "WriteProfileStringA" _ (ByVal lpszSection As String, _
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 have to save some user configuration of an application. Where will we save that in .NET?
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, "", ProfileString, Len(ProfileString)) Or where this goes?
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 the end of the installation.) I can install the application on my development PC and on a "bare" PC. Regardless of the PC where I install, in the installed application (but not the development version) File->Export from a Report brings up a...
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 for some reason it does not appear to be being read by php. I have defined things such as upload_tmp_dir in that file yet even with restarting apache I am not seeing this reflected in phpinfo(). I am pretty new to PHP so its entirely possible...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
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 we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.