473,947 Members | 8,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:\Documen ts and Settings\UserID \Application Data\Tessella\A ppName"
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 1261

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

Similar topics

7
3656
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 generically in a column of type nvarchar(4000), but I want to add support for unlimited text. I want to do this in a smart fashion. Right now I am leaning towards putting 2 nullable Value fields: ValueLong ntext nullable ValueShort nvarchar(4000)...
4
2007
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 variable in ASP.NET? I am thinking of storing several objects there, not too large, so there won't be any memory issues or anything like that. Is ASP.NET still subject to threading issues?
6
2157
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) Thanks very much in advance, Jason
2
5062
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 storing the session in Sql Server. Please let me know if Iam doing anything wrong. Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when
7
1553
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? and is there an obvious reason why i should not do this.
4
1322
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 as much as possible. Storing it in application cache will result the calls to be made if the users are bounced from one server to another. But is this the best resolution or is there any other methodology that I can use which will be more...
1
1083
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 PageLoad, load this state and apply it to the state of the form, I don't want to loop through each name value and set it manually, I'd like to do it genericaly,
5
2214
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 database, a database connection (using the SQlDataSource Web Control from the Toolbox), and created the following stored procedure in Visual Studio.Net 2005:
9
7310
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 be 'better' to store an instance of this class in a session-variable, so it's available all the time and needs to be instanced only once. Is this, generally speaking, a good idea, storing objects in session-variables ? Do you guys ever use this...
3
2057
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 the information it contained on another page. This was significant because I am initially loading the data from the database, then storing relevent information in the object, I am allowing users to change the data then preview the modifications...
0
10164
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11168
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11348
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9889
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7431
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6117
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6332
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4539
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.