Configuration Files

  • Thread starter Thread starter Ivan Weiss
  • Start date Start date
I

Ivan Weiss

Hey all,

I am trying to add a configuration file to my app so that I can store
configuration options and provide a form to allow the user to change
them. I know that these used to always be in the form of ini files. I
am trying to learn new techniques (OOP etc..) and trying to make my app
as modern as possible. Are XML files the preferred method of doing
this? Whatever the correct way of handling configuration files is, can
someone please provide a link to a tutorial or some good help and how to
work with either ini files, xml files, or whatever is out there as I
have never had a need for a local configuration file in the past.

Thanks!

-Ivan
 
You can also save, edit and delete your configurations in the registry.

Set the filter on your search in help to .NET and then search for
'registry' or 'registry key'. It will return several results.

The help files come in handy sometimes, when researching theories and
solutions.
 
Hi Ivan,

What is prefered. But an ini file is not prefered.

You can use the dataset methode (do not become scared).

It is very simple to build your config file with it.

You can read it with dsConfig.readXML("myconfig.xml")
You can write it with dsConfig.writeXML("myconfig.xml)"

The most simple method to build it is to open a dataset in your solution
explorer and add the "elements" to it

If you have than questions, ask again.

I hope this helps?

Cor.
 
Search for PSS ID Number: Q313405

This describes another method which you can use.

Regards - OHM
 
I was reading through those posts as suggested and noticed they are
app-wide settings. Will these work for local settings also per each
client. I want it to contain very basic information like the folder
that my access database is stored in (since it will be stored on a
server I want each user to be able to have the option of mapping a drive
etc...) Can I use those classes as described in the article you
provided or do I need to write my own class to read/write from xml
files. It seems that this is something the .NET framework should
provide considering it used to provide functions for dealing with ini
files.

-Ivan
 
Back
Top