IsolatedStorageScope 列舉

定義

列舉由 IsolatedStorage 所支援的隔離儲存區 (Isolated Storage) 範圍層次。

此列舉支援其成員值的位元組合。

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

欄位

Application 32

範圍限定於應用程式的隔離儲存區。

Assembly 4

範圍限定於組件 (Assembly) 識別 (Identity) 的隔離儲存區。

Domain 2

範圍限定於應用程式定義域識別的隔離儲存區。

Machine 16

範圍限定於電腦的隔離儲存區。

None 0

沒有隔離儲存區的使用。

Roaming 8

隔離儲存區可以放置在可能漫遊的檔案系統某一處 (如果漫遊使用者資料在基礎作業系統中啟用)。

User 1

由使用者識別限定範圍的隔離儲存區。

範例

下列程式碼範例示範如何在 IsolatedStorageScope 方法中使用 GetStore 列舉。

// 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 指定隔離存放區的範圍程度。 您可以指定 支援之這些層級 IsolatedStorage 的組合。

適用於

另請參閱