Share via


Isolated Storage and Roaming

Roaming user profiles are a Microsoft Windows feature (available on some updated Windows 98 systems, Windows NT, Windows 2000, Windows XP, and Windows Vista) that enables a user to set up an identity on a network and use that identity to log into any network computer, carrying over all personalized settings. An assembly that uses isolated storage can specify that the user's isolated storage move with the roaming user profile. Roaming can be used in conjunction with isolation by user and assembly or with isolation by user, domain, and assembly. If a roaming scope is not used, stores will not roam even if a roaming user profile is used.

Example

The following code example retrieves a roaming store isolated by user and assembly. The store can be accessed through the isoFile object.

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);

A domain scope can be added to create a roaming store isolated by user, domain, and application. The following code example demonstrates this.

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);

See Also

Concepts

Types of Isolation

Isolation by User and Assembly

Isolation by User, Domain, and Assembly

Other Resources

Isolated Storage