O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 32. System.IO.IsolatedStorage

System.IO.IsolatedStorage allows you to access an isolated area of a filesystem for your application. This is useful when access to the System.IO classes is not possible. The security settings of the .NET Framework prohibit web applications and downloaded controls from accessing the local filesystem directly, but those settings allow them to use System.IO.IsolatedStorage. Applications’ storage areas are isolated from one another, so anything in isolated storage is protected from untrusted applications. The size of isolated storage is limited, so an untrusted application cannot create a denial-of-service condition by filling your hard disk with data.

When you use isolated storage, the runtime sets aside disk space for a given level of isolation (specified using IsolatedStorageScope). If you use Windows 2000 or XP, <SYSTEMDRIVE>\Documents and Settings\<user>\Application Data contains the isolated storage area if roaming is turned on, and <SYSTEMDRIVE>\Documents and Settings\<user>\Local Settings\Application Data contains the storage area if roaming is not on. Applications can use this area as a data store for their particular persistence needs. Figure 32-1 shows the inheritance diagram for this namespace. For more information, see Section 10.4 in Chapter 10.

The System.IO.IsolatedStorage namespace

Figure 32-1. The System.IO.IsolatedStorage namespace

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required