IsolatedStorageFile.GetUserStoreForApplication Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Obtains user-scoped isolated storage corresponding to the calling code's application identity.
public:
static System::IO::IsolatedStorage::IsolatedStorageFile ^ GetUserStoreForApplication();
public static System.IO.IsolatedStorage.IsolatedStorageFile GetUserStoreForApplication ();
static member GetUserStoreForApplication : unit -> System.IO.IsolatedStorage.IsolatedStorageFile
Public Shared Function GetUserStoreForApplication () As IsolatedStorageFile
Returns
An object corresponding to the isolated storage scope based on the calling code's assembly identity.
Exceptions
Sufficient isolated storage permissions have not been granted.
An isolated storage location cannot be initialized.
-or-
The application identity of the caller cannot be determined, because the ActivationContext property returned null
.
-or-
The permissions for the application domain cannot be determined.
Remarks
All assemblies associated with an application use the same isolated store when using this method. This method can be used only when the application identity can be determined - for example, when the application is published through ClickOnce deployment or is a Silverlight-based application. If you attempt to use this method outside a ClickOnce or Silverlight-based application, you will receive an IsolatedStorageException exception, because the application identity of the caller cannot be determined.
GetUserStoreForApplication is functionally equivalent to the following code:
isoFile = IsolatedStorageFile::GetStore(IsolatedStorageScope::Application |
IsolatedStorageScope::User, (Type^)nullptr);
isoFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.Application |
IsolatedStorageScope.User, null);
isoFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.Application Or _
IsolatedStorageScope.User, Nothing)
In this code, the applicationIdentity
parameter for GetStore(IsolatedStorageScope scope, Object applicationIdentity)
is null
.