config file - How to ?

  • Thread starter Thread starter John Devlon
  • Start date Start date
J

John Devlon

Hi,

I would like to create a config file to store some basic user data like
default path, and some other options ...

Does anyone know which is the best solution ? Using an xml-file ? Or using a
basic txt-file ? Or are there other solutions to remember user settings ?

thanx

John
 
John Devlon said:
Hi,

I would like to create a config file to store some basic user data like
default path, and some other options ...

Does anyone know which is the best solution ? Using an xml-file ? Or using
a basic txt-file ? Or are there other solutions to remember user settings
?

thanx

John

Yep. Use Application Settings. Choose Settings from your Project's
Properties. Select User for the Scope. All your User preferences can be
added here. You can even update them via code etc.

Cheers.
 
I am not saying this is the best solution but I am using the registry
to store the info. It is actually pretty easy and you don't have to
worry about having a seperate config file around.

Just a possibility. : )

-Josh
 
Hi Greg,

Thanx for the great advice...

Do you know where I can find a good manuel on the web on how to read and
write to the user preferences ?

Many Thanx

John
 
John Devlon said:
Hi Greg,

Thanx for the great advice...

Do you know where I can find a good manuel on the web on how to read and
write to the user preferences ?

Many Thanx

John

It's very basic. Add in your user preferences (I change their Roaming
property from False to True).

To read a value: eg,
sAppVers = My.Settings.AppVers
sDatabaseDir = My.Settings.DatabaseDirectory
sInputDir = My.Settings.InputDirectory

To save a new value: eg,
My.Settings.AppVers = "1.1"
My.Settings.DBName = "northwind.mdb"
My.Settings.Save()

Very easy. Cheers.
 
Back
Top