IsolatedStorageScope 枚举
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
枚举 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
- 继承
- 特性
字段
| 名称 | 值 | 说明 |
|---|---|---|
| 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支持。