IsolatedStorageScope 列舉

定義

列舉由 IsolatedStorage 所支援的隔離儲存區 (Isolated Storage) 範圍層次。Enumerates the levels of isolated storage scope that are supported by IsolatedStorage.

此列舉具有 FlagsAttribute 個屬性允許以位元方式合併其成員值。

public enum class IsolatedStorageScope
public enum IsolatedStorageScope
[System.Flags]
public enum IsolatedStorageScope
[System.Flags]
[System.Serializable]
public enum IsolatedStorageScope
[System.Flags]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum IsolatedStorageScope
type IsolatedStorageScope = 
Public Enum IsolatedStorageScope
繼承
IsolatedStorageScope
屬性

欄位

Application 32

範圍限定於應用程式的隔離儲存區。Isolated storage scoped to the application.

Assembly 4

範圍限定於組件 (Assembly) 識別 (Identity) 的隔離儲存區。Isolated storage scoped to the identity of the assembly.

Domain 2

範圍限定於應用程式定義域識別的隔離儲存區。Isolated storage scoped to the application domain identity.

Machine 16

範圍限定於電腦的隔離儲存區。Isolated storage scoped to the machine.

None 0

沒有隔離儲存區的使用。No isolated storage usage.

Roaming 8

隔離儲存區可以放置在可能漫遊的檔案系統某一處 (如果漫遊使用者資料在基礎作業系統中啟用)。The isolated store can be placed in a location on the file system that might roam (if roaming user data is enabled on the underlying operating system).

User 1

由使用者識別限定範圍的隔離儲存區。Isolated storage scoped by user identity.

範例

下列程式碼範例示範如何在 GetStore 方法中使用 IsolatedStorageScope 列舉。The following code example demonstrates how the IsolatedStorageScope enumeration is used in the GetStore methods.

// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile^ isoFile = IsolatedStorageFile::GetStore( static_cast<IsolatedStorageScope>(IsolatedStorageScope::User | IsolatedStorageScope::Assembly | IsolatedStorageScope::Domain), (Type^)nullptr, nullptr );
IsolatedStorageFileStream^ isoStream = gcnew IsolatedStorageFileStream( this->userName,FileMode::Open,FileAccess::ReadWrite,isoFile );


// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile isoFile =
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
    IsolatedStorageScope.Assembly |
    IsolatedStorageScope.Domain,
    null,
    null);

IsolatedStorageFileStream isoStream =
    new IsolatedStorageFileStream("substituteUsername",
    System.IO.FileMode.Open,
    System.IO.FileAccess.Read,
     System.IO.FileShare.Read);
' Retrieve an IsolatedStorageFile for the current Domain and Assembly.
Dim isoFile As IsolatedStorageFile = _
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User _
    Or IsolatedStorageScope.Assembly _
    Or IsolatedStorageScope.Domain, Nothing, Nothing)

Dim isoStream As New IsolatedStorageFileStream("substituteUsername", System.IO.FileMode.Open, _
    System.IO.FileAccess.Read, System.IO.FileShare.Read)

備註

使用 IsolatedStorageScope 指定隔離存放區的範圍程度。Use IsolatedStorageScope to specify a degree of scope for an isolated store. 您可以指定 IsolatedStorage支援的這些層級組合。You can specify combinations of these levels that are supported by IsolatedStorage.

適用於

另請參閱