How to store application information?

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

I just saw this program called Handy Backup 4.5 where you can add backup
jobs as such... and I wonder where you normally save data in an application.

I come from an ASP world and have started to get into Windows Forms and
Desktop programming and for me it's always been a Database-Way to go when
wanting to save data.. or in the Registry when it comes to usersettings. But
in the application I was looking at I looked into the installation folder
and I could'nt see any big files, databases or anything big in the registry
for the application so where do you save the Backup jobs and information
about them that you can create in the application?

I'm not asking to check into the program but I'd like to know what the
normal approach is to store application data that needs to be "remembered"
till the next time you run the application.

/Lars Netzel
 
But yeah... it's just that the progam I saw does'nt save anywhere where I
can see it..

I was thinking something more professional that creating a textfile in an
obvious directory

No I have been reading about Isolated Storage a while and that seems to be
the way to go for me..

/lars
 
Take a look at the configuration block (available for free download from MS
and it includes source code)
 
I store my Application and User Settings in two classes in the application
and use the XMLSerializer to stream them out to, and read them in from a
settings.xml file.

User specific Settings go to Application.UserAppDataPath (Resolves to
C:\Documents and
Settings\[username]\ApplicationData\[CompanyName]\[ApplicationName]\[Version
])
Application wide Settings to go Application.CommonAppDataPath (resolves to
C:\Documents and Settings\All
Users\ApplicationData\[CompanyName]\[ApplicationName]\[Version]

I have a Function in my LoadSettings Function that searches the path for an
older Settings file, and moves it up to the current version if one doesn't
exist.

Probably pretty much exactly what you'll do with IsolatedStorage, just a
different directory to store it in.
 
Back
Top