this blog contains information for .net and sql stuffs. You can find various tips and tricks to overcome problem you may be facing in ...

Sunday, February 7, 2010

Isolated Storage in .net

It’s a one type of file system provided by .net framework. Isolated storage provides protection on the user, by application domain, assembly that is not provided by the standard file system.

To access file in Isolated storage is restricted to user who have created it. i.e Assembly X can’t access the file created in the Isolated storage of Assembly Y ,same in reverse is not possible.

Even we can restrict in application domain level, same assembly running in the different application domain can’t access the file of each others.

To Use Isolated storage we need to import System.IO.IsolatedStorage namespace. It provides the required classes for Isolated Storage.

You can create the Isolated Storage file by creating instance of IsolatedStorageFileStream class. Pass the name of your file name in the constructor. You will also find different overloaded constructor in it.

Now one common question arise in mind , Where does the file store in our file system? Because we don’t see in the our application’s folder or anywhere…

You can check that file created in the below location..

Go to your root directory from where operation system is loaded (Simply operating system is installed)

Yes now firstly from tools check to see hidden files and system files because isolated storage is hidden.

Click on the Documents and Settings, this folder contains the various users on the computer and some of the services folder all these can be viewed if you have selected to show hidden files.

Click on the user with you have logged to machine. Now you have many hidden files and folder. In that click on the Local Settings -- > Application Data, that contains the folder IsolatedStorage.

This IsolatedStorage folder may have one or many folder inside of it, go to inside at last you will have Files folder and that contains your file which you have created programmatically by your application.

If you don’t find your file in the Local Settings you can also check in the Application Data folder in side the User’s folder.

No comments: