Peristent Data - Registry, Settings

Q

query_me2001

I am trying to find the best way to save data between application
sessions. I have an options form that can be used to configure an
application. This information needs to be stored so that it can be
loaded up when the application next starts.

In terms of persistency I have confusion around the following:
Registry, Settings and Resources

My original thought was to store this data in the registry; however I
stumbled over the concept of the Properties.Settings.

Can anyone advice me what would be the best option. Are they both
equivalent? Any useful link would be appreciated.

What is the relationship between the Settings and a Resource file?

BTW, I am using VS2005 and .NET 2.0

Thanks, me
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

In terms of persistency I have confusion around the following:
Registry, Settings and Resources

You should not use resources for this (not even sure if you can).

IMO the best way to do this is creating a file in the user's application
data, this way different users can have different settings

you can use either a XML file or a regular text file
 
Q

query_me2001

Ignacio said:
Hi,



You should not use resources for this (not even sure if you can).

IMO the best way to do this is creating a file in the user's application
data, this way different users can have different settings

you can use either a XML file or a regular text file

Thanks for the comments. Just to provide more information. The machine
will not be password protected so there will be no concept of
individual users. So any settings will be on a per machine basis
 
S

sloan

You can write your own file (user.config).

Or you might try something like

userSettings.xml

You could create a small object, that has a few properties on it.

class UserSettings
public string HomeDirectory
public string LastUsedLoginName

and then serialize the class/object to xml.

Here is some xml help.

9/21/2005
XmlSerialization with IDictionary and CollectionBase Objects
http://sholliday.spaces.live.com/blog/

Check that article.

By the end of it, you should be much more famaliar with serializing custom
objects.

...
 

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