IsolatedStorageFile.GetMachineStoreForDomain Method ()
Obtains machine-scoped isolated storage corresponding to the application domain identity and the assembly identity.
Assembly: mscorlib (in mscorlib.dll)
Sufficient isolated storage permissions have not been granted.
The store failed to open.
The assembly specified has insufficient permissions to create isolated stores.
The permissions for the application domain cannot be determined.
An isolated storage location cannot be initialized.
The same assembly code will use different isolated stores when used in the context of different applications.
is functionally equivalent to the following code:
isoFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain | IsolatedStorageScope.Machine, null, null);
Different assemblies running within the same application domain always have distinct isolated stores.
GetUserStoreForDomain will return an IsolatedStorageFile object without a quota if the application domain into which the assembly is installed does not have IsolatedStorageFilePermission. Later attempts to create an IsolatedStorageFile object using the IsolatedStorageFile object that does not have a quota will fail with an IsolatedStorageException.
IsolatedStorageFile isoFile; isoFile = IsolatedStorageFile.GetUserStoreForDomain(); // Open or create a writable file. IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream(this.userName, FileMode.OpenOrCreate, FileAccess.Write, isoFile); StreamWriter writer = new StreamWriter(isoStream); writer.WriteLine(this.NewsUrl); writer.WriteLine(this.SportsUrl); // Calculate the amount of space used to record the user's preferences. double d = isoFile.CurrentSize / isoFile.MaximumSize; Console.WriteLine("CurrentSize = " + isoFile.CurrentSize.ToString()); Console.WriteLine("MaximumSize = " + isoFile.MaximumSize.ToString()); // StreamWriter.Close implicitly closes isoStream. writer.Close(); isoFile.Dispose(); isoFile.Close(); return d;
Available since 2.0