IsolatedStorageFile.GetUserStoreForApplication 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得使用者範圍的隔離儲存空間,對應呼叫程式碼的應用程式身份。
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
傳回
一個對應於呼叫程式碼組合身份的隔離儲存範圍的物件。
例外狀況
尚未獲得足夠的隔離儲存許可。
備註
使用此方法時,所有與應用程式相關的組件皆使用相同的隔離儲存庫。 此方法僅在可確定應用程式身份時使用——例如應用程式透過 ClickOnce 部署發佈或是基於 Silverlight 的應用程式。 如果你嘗試在 ClickOnce 或 Silverlight 應用程式之外使用此方法,將會收到 IsolatedStorageException 例外,因為無法確定呼叫者的應用程式身份。
GetUserStoreForApplication 在功能上等價於以下程式碼:
isoFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.Application |
IsolatedStorageScope.User, null);
isoFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.Application Or _
IsolatedStorageScope.User, Nothing)
在此碼中, applicationIdentity 參數 GetStore(IsolatedStorageScope scope, Object applicationIdentity) 為 null。