IsolatedStorageContainment 列挙体とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > IsolatedStorageContainment 列挙体の意味・解説 

IsolatedStorageContainment 列挙体

使用できる分離ストレージを指定します。

名前空間: System.Security.Permissions
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Enumeration IsolatedStorageContainment
Dim instance As IsolatedStorageContainment
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public enum IsolatedStorageContainment
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public enum class IsolatedStorageContainment
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public enum IsolatedStorageContainment
SerializableAttribute 
ComVisibleAttribute(true) 
public enum IsolatedStorageContainment
メンバメンバ
 メンバ名説明
AdministerIsolatedStorageByUserユーザー ストアの無制限の管理機能。ユーザー ストア全体の参照と削除を許可しますが、ユーザー独自のドメイン/アセンブリ ID 以外の読み取りアクセスは許可しません。 
ApplicationIsolationByMachineストレージは、初めにコンピュータごとに分離され、次にアプリケーションごとに分離されます。これは、任意のドメイン コンテキストでアクセスできるアプリケーションのデータ ストアを提供します。アプリケーションごとのデータ コンパートメントでは、さらに信頼性が必要となります。これは、アプリケーション間に "トンネル" が発生し、特定の Web サイトでアプリケーションのデータ分離を損なう可能性があるためです。 
ApplicationIsolationByRoamingUserストレージは、初めにユーザーごとに分離され、次にアプリケーションの証拠ごとに分離されます。Windows ユーザー データ ローミングが有効になっている場合、ストレージは移動します。これは、任意のドメイン コンテキストでアクセスできるアプリケーションのデータ ストアを提供します。アプリケーションごとのデータ コンパートメントでは、さらに信頼性が必要となります。これは、アプリケーション間に "トンネル" が発生し、特定の Web サイトでアプリケーションのデータ分離を損なう可能性があるためです。 
ApplicationIsolationByUserストレージは、初めにユーザーごとに分離され、次にアプリケーションごとに分離されます。また、ストレージは、コンピュータごとにも分離されます。これは、任意のドメイン コンテキストでアクセスできるアプリケーションのデータ ストアを提供します。アプリケーションごとのデータ コンパートメントでは、さらに信頼性が必要となります。これは、アプリケーション間に "トンネル" が発生し、特定の Web サイトでアプリケーションのデータ分離を損なう可能性があるためです。 
AssemblyIsolationByMachineストレージは、初めにコンピュータごとに分離され、次にコード アセンブリごとに分離されます。これは、任意のドメイン コンテキストでアクセスできるアセンブリにデータ ストアを提供します。アセンブリごとのデータ コンパートメントでは、さらに信頼性が必要となります。これは、アプリケーション間に "トンネル" が発生し、特定の Web サイトでアプリケーションのデータ分離を損なう可能性があるためです。 
AssemblyIsolationByRoamingUserストレージは、初めにユーザーごとに分離され、次にアセンブリの証拠ごとに分離されます。Windows ユーザー データ ローミングが有効になっている場合、ストレージは移動します。これは、任意のドメイン コンテキストでアクセスできるアセンブリにデータ ストアを提供します。アセンブリごとのデータ コンパートメントでは、さらに信頼性が必要となります。これは、アプリケーション間に "トンネル" が発生し、特定の Web サイトでアプリケーションのデータ分離を損なう可能性があるためです。 
AssemblyIsolationByUserストレージは、初めにユーザーごとに分離され、次にコード アセンブリごとに分離されます。また、ストレージは、コンピュータごとにも分離されます。これは、任意のドメイン コンテキストでアクセスできるアセンブリにデータ ストアを提供します。アセンブリごとのデータ コンパートメントでは、さらに信頼性が必要となります。これは、アプリケーション間に "トンネル" が発生し、特定の Web サイトでアプリケーションのデータ分離を損なう可能性があるためです。 
DomainIsolationByMachineストレージは、初めにコンピュータごとに分離され、次にドメインとアセンブリごとに分離されます。同じアプリケーションのコンテキストで、同じコンピュータ上で実行する場合にだけデータにアクセスできます。これはサード パーティ アセンブリが、プライベート データ ストアを保持する場合に役立ちます。 
DomainIsolationByRoamingUserストレージは、初めにユーザーごとに分離され、次にドメインとアセンブリごとに分離されます。Windows ユーザー データ ローミングが有効になっている場合、ストレージは移動します。同じアプリケーションのコンテキストで、同じユーザーが実行する場合にだけデータにアクセスできます。これはサード パーティ アセンブリが、プライベート データ ストアを保持する場合に役立ちます。 
DomainIsolationByUserストレージは、初めにユーザーごとに分離され、次にドメインとアセンブリごとに分離されます。また、ストレージは、コンピュータごとにも分離されます。同じアプリケーションのコンテキストで、同じユーザーが実行する場合にだけデータにアクセスできます。これはサード パーティ アセンブリが、プライベート データ ストアを保持する場合に役立ちます。 
None分離ストレージの使用は許可されません。 
UnrestrictedIsolatedStorage分離ストレージの使用は、制限なしに許可されます。コードは、ドメインまたはアセンブリの ID にかかわらずユーザー ストアの任意の部分へのフル アクセスを持ちます。この分離ストレージの使用には、分離ストレージ データ ストアの内容を列挙する機能が含まれています。 
解説解説

分離ストレージは、証拠を使用して、アプリケーションまたはコンポーネントで使用する一意のストレージ エリアを決定します。アセンブリの ID によって、そのアセンブリが使用する仮想ファイル システムのルートは一意になります。このため、多くのアプリケーションとコンポーネントは、ファイル システムやレジストリなどの共通リソースを共有するのではなく、それぞれに独自のファイル領域が割り当てられます。

分離ストレージを割り当てる場合は、4 つの基本分離スコープを使用します。

URL、サイト、およびゾーンの定義については、UrlIdentityPermission、SiteIdentityPermission、ZoneIdentityPermission の各トピックを参照してください。

これらの ID は共にグループ化されます。この場合、ID は必要な分離ストレージが作成されるまで相互に適用されます。有効なグループ化は、User+Assembly と User+Assembly+Domain です。この ID のグループ化は、さまざまなアプリケーションで役に立ちます。

ドメイン、ユーザー、およびアセンブリごとにデータを格納する場合、データはそのアセンブリ内のコードだけがデータにアクセスできるという点でプライベートです。データ ストアが内部で実行されるアプリケーションによっても、そのストアは分離され、これによってアセンブリがデータを他のアプリケーションに公開することによって生じる可能性があるリークが回避されます。

アセンブリとユーザーごとの分離は、複数のアプリケーションにわたって適用されるユーザー データで使用できます。たとえば、これにはライセンス情報、またはアプリケーションに依存しないユーザーの個人情報 (名前、資格情報など) があります。

IsolatedStorageContainment は、アプリケーションが分離ストレージを使用できるかどうかと、使用できる場合は、使用を許可されている ID の組み合わせを決定するフラグを公開します。これは、アプリケーションがユーザーと共に移動する場所に情報を保存できるかどうかも決定します。Windows ローミング ユーザー プロファイルまたはフォルダ リダイレクトを構成する必要があります。

使用例使用例

このアセンブリのコードに IsolatedStoragePermission が必要なことを CLR に伝える方法を次のコード例に示します。この例では、分離ストレージの書き込みと読み取りを行う方法も示します。

using System;
using System.Security.Permissions;
using System.IO.IsolatedStorage;
using System.IO;

// Notify the CLR to grant this assembly the IsolatedStorageFilePermission.
 
// This allows the assembly to work with storage files that are isolated
 
// by user and assembly.
[assembly: IsolatedStorageFilePermission(SecurityAction.RequestMinimum, UsageAllowed
 = IsolatedStorageContainment.AssemblyIsolationByUser)]

public sealed class App
{
    static void Main()
    {
        // Attempt to create a storage file that is isolated by user
 and assembly.
        // IsolatedStorageFilePermission granted to the attribute at
 the top of this file 
        // allows CLR to load this assembly and execution of this statement.
        using (Stream s = new IsolatedStorageFileStream("AssemblyData",
 FileMode.Create, IsolatedStorageFile.GetUserStoreForAssembly()))
        {
         
             // Write some data out to the isolated file.
             using (StreamWriter sw = new StreamWriter(s))
             {
                sw.Write("This is some test data.");
             }
        }

        // Attempt to open the file that was previously created.
        using (Stream s = new IsolatedStorageFileStream("AssemblyData",
 FileMode.Open, IsolatedStorageFile.GetUserStoreForAssembly()))
        {
             // Read the data from the file and display it.
             using (StreamReader sr = new StreamReader(s))
             {
                 Console.WriteLine(sr.ReadLine());
             }
        }
    }
}

// This code produces the following output.
//
//  Some test data.
using namespace System;
using namespace System::Security;
using namespace System::Security::Permissions;
using namespace System::IO::IsolatedStorage;
using namespace System::IO;

// Notify the CLR to grant this assembly the IsolatedStorage-
// FilePermission. This allows the assembly to work with storage
// files that are isolated by user and assembly.
[assembly: IsolatedStorageFilePermission(
    SecurityAction::RequestMinimum, UsageAllowed =
    IsolatedStorageContainment::AssemblyIsolationByUser)];
int main()
{
    try
    {
        // Attempt to create a storage file that is isolated by
        // user and assembly. IsolatedStorageFilePermission
        // granted to the attribute at the top of this file
        // allows CLR to load this assembly and execution of this
        // statement.
        Stream^ fileCreateStream = gcnew
            IsolatedStorageFileStream(
            "AssemblyData",
            FileMode::Create,
            IsolatedStorageFile::GetUserStoreForAssembly());

        StreamWriter^ streamWriter = gcnew StreamWriter(
            fileCreateStream);
        try
        {
            // Write some data out to the isolated file.

            streamWriter->Write("This is some test data.");
            streamWriter->Close();    
        }
        finally
        {
            delete fileCreateStream;
            delete streamWriter;
        } 
    }
    catch (IOException^ ex)
    {
        Console::WriteLine(ex->Message);
    }

    try
    {
        Stream^ fileOpenStream =
            gcnew IsolatedStorageFileStream(
            "AssemblyData",
            FileMode::Open,
            IsolatedStorageFile::GetUserStoreForAssembly());
        // Attempt to open the file that was previously created.

        StreamReader^ streamReader = gcnew StreamReader(
            fileOpenStream);
        try
        { 
            // Read the data from the file and display it.

            Console::WriteLine(streamReader->ReadLine());
            streamReader->Close();
        }
        finally
        {
            delete fileOpenStream;
            delete streamReader;
        }
    }
    catch (FileNotFoundException^ ex)
    {
        Console::WriteLine(ex->Message);
    }
    catch (IOException^ ex)
    {
        Console::WriteLine(ex->Message);
    }
}

// This code produces the following output.
//
//  This is some test data.
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Security.Permissions 名前空間
IsolatedStoragePermission
IsolatedStoragePermissionAttribute
IsolatedStorageFilePermission
IsolatedStorageFilePermissionAttribute
その他の技術情報
分離ストレージ



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「IsolatedStorageContainment 列挙体」の関連用語

IsolatedStorageContainment 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



IsolatedStorageContainment 列挙体のページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS