語言

IsolatedStorageScope 列舉

定義

列舉 IsolatedStorage支援的隔離儲存範圍層級。

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

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
屬性

欄位

名稱 值 Description
None 0

沒有孤立的儲存空間使用。

User 1

依使用者身份範圍的隔離儲存。

Domain 2

隔離儲存範圍依應用域身份。

Assembly 4

隔離儲存範圍對應組件的身份。

Roaming 8

隔離儲存可以放置在檔案系統中可能漫遊的位置(前提是底層作業系統啟用漫遊使用者資料)。

Machine 16

隔離儲存裝置對機器有示波器。

Application 32

針對應用程式範圍的隔離儲存。

範例

以下程式碼範例展示了列舉在方法IsolatedStorageScope中的應用GetStore方式。


// 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。

適用於

另請參閱