Noob confused about persistent storage options

P

Paul J. Hurley

I'm developing an app with a 3rd party COM object. The COM object allows
you to save (and restore) the object's configuration in a proprietary file
format to a location of your choice. In addition, my app will allow the
saving (and restore) of user preferences and options specific to the app.
The app itself won't be saving any data files specific to it's operation.

My question: What are the "best practice" rules for storing these data
items? Where should he COM's config file be saved? Should I store the app
data in the registry or in a special file in a specific folder?

Thanks
Paul
 
E

Ed Courtenay

Paul said:
I'm developing an app with a 3rd party COM object. The COM object allows
you to save (and restore) the object's configuration in a proprietary file
format to a location of your choice. In addition, my app will allow the
saving (and restore) of user preferences and options specific to the app.
The app itself won't be saving any data files specific to it's operation.

My question: What are the "best practice" rules for storing these data
items? Where should he COM's config file be saved? Should I store the app
data in the registry or in a special file in a specific folder?

The standard I use is if the settings are application specific (i.e. not
dependant on user preferences) then I store them in the application
folder (normally as a serialized XML document).

User specific settings are stored in a subfolder off the Application
Data folder (so that settings can follow roaming users). So for example:

using System;
using System.IO;

....

public static string GetUserPreferencesFolder() {
return
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"MyApp");
}
 
E

Erik Frey

Paul J. Hurley said:
I'm developing an app with a 3rd party COM object. The COM object allows
you to save (and restore) the object's configuration in a proprietary file
format to a location of your choice. In addition, my app will allow the
saving (and restore) of user preferences and options specific to the app.
The app itself won't be saving any data files specific to it's operation.

My question: What are the "best practice" rules for storing these data
items? Where should he COM's config file be saved? Should I store the app
data in the registry or in a special file in a specific folder?

Thanks
Paul

The Genghis Project (http://www.sellsbrothers.com/tools/genghis/) has a
Preferences class that is simple but very useful. It uses the
System.IO.IsolatedStorage class for its underlying data store method.

You can read more about isolated storage here:


http://msdn.microsoft.com/library/d...e/html/cpconIntroductionToIsolatedStorage.asp

Erik
 

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