独立存储和漫游

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

示例

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

Dim isoFile As IsolatedStorageFile = _
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or _
        IsolatedStorageScope.Assembly Or _
        IsolatedStorageScope.Roaming, Nothing, Nothing)
IsolatedStorageFile isoFile =
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
        IsolatedStorageScope.Assembly |
        IsolatedStorageScope.Roaming, null, null);
IsolatedStorageFile^ isoFile =
    IsolatedStorageFile::GetStore(IsolatedStorageScope::User |
        IsolatedStorageScope::Assembly |
        IsolatedStorageScope::Roaming, (Type^)nullptr, (Type^)nullptr);

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

Dim isoFile As IsolatedStorageFile = _
    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);
IsolatedStorageFile^ isoFile =
    IsolatedStorageFile::GetStore(IsolatedStorageScope::User |
        IsolatedStorageScope::Assembly | IsolatedStorageScope::Domain |
        IsolatedStorageScope::Roaming, (Type^)nullptr, (Type^)nullptr);

请参见

概念

独立存储

隔离的类型

按用户和程序集隔离

按用户、域和程序集隔离