473,387 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Storing state data

I am looking for different opinions on how the state data of a .NET
application should be stored. An example would be the size and location of
the main application window. This allows the users' preferences to be
restored the next time the application is run.

The classic DOS/Windows method was to use a ".ini" file in the application
directory. This had the advantage of being very easy to backup and would be
deleted if the application were uninstalled by deletion of the parent
directory.

Along came Windows 95 and the advice from Microsoft was to store all
application settings in the registry. This has the disadvantage that the
settings are not removed by deleting the application. Even using a proper
uninstaller (e.g. InstallShield) will not remove all of these settings if
they were created at runtime instead of install time.

Now we have the NT/2000/XP line from Microsoft. This has built in file
security so we can no longer store a ".ini" file in the application
directory because the current user might not have write access to the
Program Files directory. Microsoft have kindly provided us with a special
directory for this purpose at some memorable location such as:
"C:\Documents and Settings\UserID\Application Data\Tessella\AppName"
This has the same disadvantages as the registry in that most users will not
know it exists and if the file is created or modified during runtime, the
uninstall program will not remove it.

We now have the claim that a .NET application can be installed with a
simple copy operation such as xcopy and that all of our settings should be
stored in an XML file. Where should we place this XML file? We cannot place
it in the application directory because the user might not have write
access to it. Last time I checked, xcopy was unable to dynamically obtain
the Application Data directory.

Do you use XML files with your .NET applications or do you still use the
registry?

How do other operating systems or development platforms deal with this?

Microsoft has recently released "Microsoft Application Blocks for .NET"
which seems to solve all of these problems. See:
http://msdn.microsoft.com/library/en.../html/cmab.asp
This gives me confidence I'm not the only one having this problem. Has
anyone used this?
Jul 21 '05 #1
0 1225

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dave | last post by:
I have a system that basically stores a database within a database (I'm sure lots have you have done this before in some form or another). At the end of the day, I'm storing the actual data...
4
by: Frank Rizzo | last post by:
In classic ASP, it was considered a bad idea to store VB6-created objects in the Application variable for various threading issues. What's the current wisdom on storing objects in the Application...
6
by: Jason | last post by:
Is it possible to store an entire datatable/dataset in session state? If so, could someone please provide a code snippet or a link to documentation for me please? (I'm having no luck at all) ...
2
by: jakk | last post by:
Below is the exception that Iam getting. It says that the DataView that Iam storing in the session is not Serializable. BUt works fine if I store in the inproc session and fails if I switch to...
7
by: py | last post by:
how feasible is it to cache an entire page's content in a session variable? i am already doing it and it works fine, except i am afraid of scalability issues. what is the best way to test this? ...
4
by: kanones | last post by:
I have some data that is been retrieved from a call to sql server stored procedure that I want to store for a period of time in a web farm architecture. I want to minimize the calls to sql server...
1
by: garethdjames | last post by:
I am looking for a generic way of storing and reloading form data, I will implement IPostBackHandler and enumerate through the form objects, then persist them to my DB, I then want to on...
5
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
9
by: david | last post by:
I have a class with some business-logic and with every roundtrip, I need an instance of this class, so I have to create it, every time again. That doesn't seem very efficient. I thought it would...
3
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.