Best Place to Store Personal Settings

M

Marco

Hi to All,

I'm developing an application in VB .NET. I have a question: what is the
best place to save personal settings of my users? I mean, when a user uses
my application, it can create a personal profile (e.g. last files opened,
custom settings, etc...). What is the best place to save them? At first, I
thought to save them in the registry, in the CURRENT_USER section, but I'm
not sure every user can have read/write access to it.

What do you suggest? Where can I find more information?
Thanks,

Paolo
 
H

Herfried K. Wagner [MVP]

* "Marco said:
I'm developing an application in VB .NET. I have a question: what is the
best place to save personal settings of my users? I mean, when a user uses
my application, it can create a personal profile (e.g. last files opened,
custom settings, etc...). What is the best place to save them? At first, I
thought to save them in the registry, in the CURRENT_USER section, but I'm
not sure every user can have read/write access to it.

'Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)'
or 'Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)'
 
G

Guest

I would suggest Mr. Wagner's method with just 2 additions:
1) Store your settings in a subfolfer of AppData (i.e.
'Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"MyAppName." Don't worry, it's considered OK to leave behind your app's data
in this folder even after uninstall. In fact, it's considered bad form to
delete it.
2) Store your settings in an XML file in this directory... make your job
easier by creating your simple "GetSettings(Section,
Key)/WriteSetting(Section, Key, Value)" functions to mimic traditional INI
files.

However, if your program is a database client, I prefer to store my user's
settings in a table in the database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top