IsolatedStorageScope 枚举

定义

枚举受 IsolatedStorage 支持的独立存储范围级别。Enumerates the levels of isolated storage scope that are supported by IsolatedStorage.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class 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

范围限制在程序集标识内的独立存储。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.

示例

下面的代码示例演示如何IsolatedStorageScope GetStore在方法中使用枚举。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.

适用于

另请参阅