次の方法で共有


IsolatedStorageScope 列挙体

IsolatedStorage がサポートしている分離ストレージ スコープのレベルを列挙します。

この列挙体には、メンバ値をビットごとに演算するための FlagsAttribute 属性が含まれています。

<Flags>
<Serializable>
Public Enum IsolatedStorageScope
[C#]
[Flags]
[Serializable]
public enum IsolatedStorageScope
[C++]
[Flags]
[Serializable]
__value public enum IsolatedStorageScope
[JScript]
public
   Flags
 Serializable
enum IsolatedStorageScope

解説

分離ストアのスコープのレベルを指定するには、 IsolatedStorageScope を使用します。 IsolatedStorage がサポートしているレベルを組み合わせて指定できます。

メンバ

メンバ名 説明
Assembly アセンブリの ID によってスコープが指定されている分離ストレージ。 4
Domain アプリケーション ドメイン ID によってスコープが指定されている分離ストレージ。 2
None 分離ストレージを使用しない。 0
Roaming ローミング ユーザー データが、基になるオペレーティング システムで有効になっている場合、分離ストアは、移動先のファイル システム上に配置できます。 8
User ユーザー ID によってスコープが指定されている分離ストレージ。 1

使用例

[Visual Basic, C#, C++] 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)

[C#] 

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

[C++] 
// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile* isoFile =
   IsolatedStorageFile::GetStore(
   static_cast<IsolatedStorageScope>(IsolatedStorageScope::User | 
   IsolatedStorageScope::Assembly |
   IsolatedStorageScope::Domain),
   (Type*)0, 0);
IsolatedStorageFileStream* isoStream = new IsolatedStorageFileStream(this->userName,
   FileMode::Open,  
   FileAccess::ReadWrite,
   isoFile);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

名前空間: System.IO.IsolatedStorage

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: Mscorlib (Mscorlib.dll 内)

参照

System.IO.IsolatedStorage 名前空間 | 分離のタイプ