Library tutorials & articles
Isolated Storage in .NET
- Overview
- Application-wide Settings
- Isolated Storage
Isolated Storage
When it comes to per-user information you can follow a couple of different paths. Either you can develop your own ad-hoc routines to store user settings and other information in various places or you can consider Isolated Storage.
Isolated storage is a special area on the hard drive that your application knows how to find. The clever thing is that your application can’t see the physical path location (this is managed by the .NET framework). What’s more your application doesn’t need permission to write to the hard drive – so this technique is suitable for .NET applications that are running in a restricted security mode. Only the User and Assembly that creates the storage can have access to it. If your corporate environment has been designed to support hot-desking then Isolated Storage also supports roaming profiles
In essence Isolated Storage is a well thought out viable storage area that you can take advantage of when you’re considering your storage options. Isolated Storage Classes live in the System.IO Namespace and consist of a Store (the storage area) which has methods to create directories and read files and you can read and write to the area using Streams.
You could write a DataSet into Isolated Storage simply using the following code:
IsolatedStorageFile storeWrite = IsolatedStorageFile.GetUserStoreForDomain();
IsolatedStorageFileStream streamWrite = new IsolatedStorageFileStream("MyXML.xml", FileMode.Create, storeWrite);
myDataSet.WriteXml(streamWrite,XmlWriteMode.WriteSchema);
streamWrite.Close();
storeWrite.Dispose();
this.Close();
In order to read it back again, you could do the following:
IsolatedStorageFile storeRead = IsolatedStorageFile.GetUserStoreForDomain();
IsolatedStorageFileStream streamRead = new IsolatedStorageFileStream("MyXML.xml", FileMode.Open, storeRead);
myDataSet.ReadXml(streamRead,XmlReadMode.ReadSchema);
streamRead.Close();
storeRead.Dispose();
There is a command line utility storeadm.exe which you can use to manually view Isolated Storage and help debug applications that make use of isolated storage. And the Isolation provided can be either configured so that the storage area cannot be shared across components in different applications, or it can be configured so that it can be shared across components in different applications. The flexibility is down to you.
For more information visit http://www.a9.com/ (you may not use Google again) and search for Isolated Storage.
Related articles
Related discussion
-
Binary Studio | software development outsourcing Ukraine
by shane124 (4 replies)
-
Research topic in software
by reachsangeethamathew (0 replies)
-
career improvement advice
by hnasr82 (0 replies)
-
Advice on studying and preparing for interviews
by caryatid (0 replies)
-
Chart insertation in a windows form...
by pdhanik (1 replies)
Related podcasts
-
More jQuery in ASP.NET
In this episode Chris Brandsma, Rick Strahl, Dave Ward, Bertrand Le Roy, and Scott Koon conclude their discussion of Microsoft's jQuery in ASP.NET announcement1.This episode of the Alt.NET Podcast is brought to you by LLBLGen Pro, the most mature O/R mapper and code generator out there.Are ...
Events coming up
-
Nov
18
15 Minutes of Fame
Dresher, United States
This is a yearly tradition. We select 10 of the favorite speakers from monthly meetings, code camps, and hands on labs. Each one does a 15 minute talk on their favorite .NET technology. This is our 10th anniversary so we plan a gala event with special prizes and refreshments.
NiceIntro into another viable storage solution.
Thanks
This thread is for discussions of Isolated Storage in .NET.