独立存储和漫游

更新:2007 年 11 月

漫游用户配置文件是 Microsoft Windows 的一项功能(某些更新过的 Windows 98 系统、Windows NT、Windows 2000、Windows XP 和 Windows Vista 提供该功能),它使用户可以在网络上设置标识和使用该标识来登录任何网络计算机,登录时即携带所有个人设置。使用独立存储的程序集可以指定用户的独立存储和漫游用户配置文件一起移动。漫游可以和按用户和程序集隔离或按用户、域和程序集隔离一起使用。如果未使用漫游范围,即使使用了漫游用户配置文件,存储区也不漫游。

示例

下面的代码示例检索按用户和程序集隔离的漫游存储区。可通过 isoFile 对象访问该存储区。

Dim isoStore As IsolatedStorageFile
isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or IsolatedStorageScope.Assembly Or IsolatedStorageScope.Roaming, Nothing, Nothing)
IsolatedStorageFile isoFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Roaming, null, null);

可以添加域范围来创建按用户、域和应用程序隔离的漫游存储区。下面的代码示例对此进行了演示。

Dim isoStore As IsolatedStorageFile
isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or IsolatedStorageScope.Assembly Or IsolatedStorageScope.Domain Or IsolatedStorageScope.Roaming, Nothing, Nothing)
IsolatedStorageFile isoFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Domain | IsolatedStorageScope.Roaming, null, null);

请参见

概念

隔离的类型

按用户和程序集隔离

按用户、域和程序集隔离

其他资源

执行独立存储任务