IsolatedStorageScope 枚举

枚举受 IsolatedStorage 支持的独立存储范围的级别。

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

**命名空间:**System.IO.IsolatedStorage
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
<FlagsAttribute> _
Public Enumeration IsolatedStorageScope
用法
Dim instance As IsolatedStorageScope
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
[FlagsAttribute] 
public enum IsolatedStorageScope
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
[FlagsAttribute] 
public enum class IsolatedStorageScope
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute FlagsAttribute() */ 
public enum IsolatedStorageScope
SerializableAttribute 
ComVisibleAttribute(true) 
FlagsAttribute 
public enum IsolatedStorageScope

成员

  成员名称 说明
Application 范围限制在应用程序内的独立存储。 
Assembly 范围限制在程序集的标识内的独立存储。 
Domain 范围限制在应用程序域标识内的独立存储。 
Machine 范围限制在机器内的独立存储。 
None 未使用独立存储。 
Roaming 独立存储区可以放置在文件系统中可以漫游的位置中(如果漫游用户数据已在基础操作系统上启用)。 
User 通过用户标识限制范围的独立存储。 

备注

使用 IsolatedStorageScope 指定独立存储区的范围级别。可以指定受 IsolatedStorage 支持的这些级别的组合。

示例

下面的代码示例演示在 GetStore 方法中如何使用 IsolatedStorageScope 枚举。

' 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(Me.userName, FileMode.Open, _
    FileAccess.Read, FileShare.Read)
// 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(this.userName,
    FileMode.Open,
    FileAccess.Read,
    FileShare.Read);
// 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 );

平台

Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

System.IO.IsolatedStorage 命名空间

其他资源

隔离的类型