IsolatedStorageContainment 열거형

정의

주의

Code Access Security is not supported or honored by the runtime.

격리된 스토리지에 허용되는 용도를 지정합니다.

public enum class IsolatedStorageContainment
public enum IsolatedStorageContainment
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum IsolatedStorageContainment
[System.Serializable]
public enum IsolatedStorageContainment
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum IsolatedStorageContainment
type IsolatedStorageContainment = 
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type IsolatedStorageContainment = 
[<System.Serializable>]
type IsolatedStorageContainment = 
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type IsolatedStorageContainment = 
Public Enum IsolatedStorageContainment
상속
IsolatedStorageContainment
특성

필드

AdministerIsolatedStorageByUser 112

사용자 저장소에 대한 무한 관리 기능입니다. 전체 사용자 저장소를 찾아 삭제할 수는 있지만 사용자의 고유한 도메인/어셈블리 ID 이외는 읽을 수 없습니다.

ApplicationIsolationByMachine 69

스토리지는 먼저 컴퓨터별로 격리된 다음 애플리케이션별로 격리됩니다. 이 경우 모든 도메인 컨텍스트에서 액세스할 수 있는 애플리케이션의 데이터 저장소가 만들어집니다. 애플리케이션별 데이터 컴파트먼트는 특정 웹 사이트에서 애플리케이션의 격리된 데이터를 노출시킬 수 있는 "터널"을 애플리케이션 간에 제공할 수 있으므로 이러한 데이터 컴파트먼트에는 트러스트를 추가해야 합니다.

ApplicationIsolationByRoamingUser 101

스토리지는 먼저 사용자별로 격리된 다음 애플리케이션 증명 정보별로 격리됩니다. Windows 사용자 데이터 로밍이 가능하도록 설정되어 있으면 스토리지가 로밍됩니다. 이 경우 모든 도메인 컨텍스트에서 액세스할 수 있는 애플리케이션의 데이터 저장소가 만들어집니다. 애플리케이션별 데이터 컴파트먼트는 특정 웹 사이트에서 애플리케이션의 격리된 데이터를 노출시킬 수 있는 "터널"을 애플리케이션 간에 제공할 수 있으므로 이러한 데이터 컴파트먼트에는 트러스트를 추가해야 합니다.

ApplicationIsolationByUser 21

스토리지는 먼저 사용자별로 격리된 다음 애플리케이션별로 격리됩니다. 스토리지는 컴퓨터별로 격리되기도 합니다. 이 경우 모든 도메인 컨텍스트에서 액세스할 수 있는 애플리케이션의 데이터 저장소가 만들어집니다. 애플리케이션별 데이터 컴파트먼트는 특정 웹 사이트에서 애플리케이션의 격리된 데이터를 노출시킬 수 있는 "터널"을 애플리케이션 간에 제공할 수 있으므로 이러한 데이터 컴파트먼트에는 트러스트를 추가해야 합니다.

AssemblyIsolationByMachine 64

스토리지는 먼저 컴퓨터별로 격리된 다음, 코드 어셈블리별로 격리됩니다. 이 멤버는 모든 도메인 컨텍스트에서 액세스할 수 있는 어셈블리에 대한 데이터 저장소를 제공합니다. 어셈블리별 데이터 컴파트먼트는 특정 웹 사이트에서 애플리케이션의 격리된 데이터를 노출시킬 수 있는 "터널"을 애플리케이션 간에 제공할 수 있으므로 어셈블리별 데이터 컴파트먼트에 트러스트를 추가해야 합니다.

AssemblyIsolationByRoamingUser 96

스토리지는 먼저 사용자별로 격리된 다음, 어셈블리 증명 정보별로 격리됩니다. Windows 사용자 데이터 로밍이 가능하도록 설정되어 있으면 스토리지가 로밍됩니다. 이 멤버는 모든 도메인 컨텍스트에서 액세스할 수 있는 어셈블리에 대한 데이터 저장소를 제공합니다. 어셈블리별 데이터 컴파트먼트는 특정 웹 사이트에서 애플리케이션의 격리된 데이터를 노출시킬 수 있는 "터널"을 애플리케이션 간에 제공할 수 있으므로 어셈블리별 데이터 컴파트먼트에 트러스트를 추가해야 합니다.

AssemblyIsolationByUser 32

스토리지는 먼저 사용자별로 격리된 다음, 코드 어셈블리별로 격리됩니다. 스토리지는 컴퓨터별로 격리되기도 합니다. 이 멤버는 모든 도메인 컨텍스트에서 액세스할 수 있는 어셈블리에 대한 데이터 저장소를 제공합니다. 어셈블리별 데이터 컴파트먼트는 특정 웹 사이트에서 애플리케이션의 격리된 데이터를 노출시킬 수 있는 "터널"을 애플리케이션 간에 제공할 수 있으므로 어셈블리별 데이터 컴파트먼트에 트러스트를 추가해야 합니다.

DomainIsolationByMachine 48

스토리지는 먼저 컴퓨터별로 격리된 다음, 도메인과 어셈블리별로 격리됩니다. 같은 컴퓨터에서 실행하는 경우에만 같은 애플리케이션의 컨텍스트에서 데이터에 액세스할 수 있습니다. 이는 타사 어셈블리에서 프라이빗 데이터 저장소를 유지하려고 할 때 유용합니다.

DomainIsolationByRoamingUser 80

스토리지는 먼저 사용자별로 격리된 다음, 도메인과 어셈블리별로 격리됩니다. Windows 사용자 데이터 로밍이 가능하도록 설정되어 있으면 스토리지가 로밍됩니다. 데이터는 같은 애플리케이션의 컨텍스트 안에서 같은 사용자가 실행할 때에만 액세스할 수 있습니다. 이는 타사 어셈블리에서 프라이빗 데이터 저장소를 유지하려고 할 때 유용합니다.

DomainIsolationByUser 16

스토리지는 먼저 사용자별로 격리된 다음, 도메인과 어셈블리별로 격리됩니다. 스토리지는 컴퓨터별로 격리되기도 합니다. 데이터는 같은 애플리케이션의 컨텍스트 안에서 같은 사용자가 실행할 때에만 액세스할 수 있습니다. 이는 타사 어셈블리에서 프라이빗 데이터 저장소를 유지하려고 할 때 유용합니다.

None 0

격리된 스토리지를 사용할 수 없습니다.

UnrestrictedIsolatedStorage 240

격리된 스토리지를 제한 없이 사용할 수 있습니다. 도메인 또는 어셈블리의 ID에 관계 없이 사용자 저장소의 모든 부분에 대한 모든 액세스 권한이 코드에 있습니다. 격리된 스토리지의 이러한 용도에는 격리된 스토리지 데이터 저장소의 콘텐츠를 열거하는 기능이 포함됩니다.

예제

이 예제에서는 이 어셈블리의 코드에 IsolatedStoragePermission을 필요로 한다고 CLR에 지시하는 방법과 격리된 스토리지에서 쓰고 읽는 방법도 보여줍니다.

using namespace System;
using namespace System::Security;
using namespace System::Security::Permissions;
using namespace System::IO::IsolatedStorage;
using namespace System::IO;


static void WriteIsolatedStorage()
{
    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);
    }
}
// Notify the CLR to only grant IsolatedStorageFilePermission to called methods. 
// This restricts the called methods to working only with storage files that are isolated 
// by user and assembly.
[IsolatedStorageFilePermission(SecurityAction::PermitOnly, UsageAllowed = IsolatedStorageContainment::AssemblyIsolationByUser)]
int main()
{
    WriteIsolatedStorage();
}

// This code produces the following output.
//
//  This is some test data.
using System;
using System.Security.Permissions;
using System.IO.IsolatedStorage;
using System.IO;

// Notify the CLR to only grant IsolatedStorageFilePermission to called methods.
// This restricts the called methods to working only with storage files that are isolated
// by user and assembly.
[IsolatedStorageFilePermission(SecurityAction.PermitOnly, UsageAllowed = IsolatedStorageContainment.AssemblyIsolationByUser)]
public sealed class App
{
    static void Main()
    {
        WriteIsolatedStorage();
    }
    private static void WriteIsolatedStorage()
    {
        // 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.
Option Strict On
Imports System.Security.Permissions
Imports System.IO.IsolatedStorage
Imports System.IO


' Notify the CLR to only grant IsolatedStorageFilePermission to called methods. 
' This restricts the called methods to working only with storage files that are isolated 
' by user and assembly.
<IsolatedStorageFilePermission(SecurityAction.PermitOnly, UsageAllowed:=IsolatedStorageContainment.AssemblyIsolationByUser)> _
Public NotInheritable Class App

    Shared Sub Main()
        WriteIsolatedStorage()
    End Sub
    Shared Sub WriteIsolatedStorage()
        ' 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.
        Dim s As New IsolatedStorageFileStream("AssemblyData", FileMode.Create, IsolatedStorageFile.GetUserStoreForAssembly())
        Try

            ' Write some data out to the isolated file.
            Dim sw As New StreamWriter(s)
            Try
                sw.Write("This is some test data.")
            Finally
                sw.Dispose()
            End Try
        Finally
            s.Dispose()
        End Try

        ' Attempt to open the file that was previously created.
        Dim t As New IsolatedStorageFileStream("AssemblyData", FileMode.Open, IsolatedStorageFile.GetUserStoreForAssembly())
        Try
            ' Read the data from the file and display it.
            Dim sr As New StreamReader(t)
            Try
                Console.WriteLine(sr.ReadLine())
            Finally
                sr.Dispose()
            End Try
        Finally
            t.Dispose()
        End Try

    End Sub
End Class

' This code produces the following output.
'
'  Some test data.

설명

격리 된 스토리지는 애플리케이션이 나 구성 요소 사용에 대 한 고유한 스토리지 영역을 확인 하려면 증거를 사용 합니다. 어셈블리의 ID는 해당 어셈블리에서 사용할 가상 파일 시스템의 루트를 고유하게 결정합니다. 따라서 많은 애플리케이션 및 구성 요소 파일 시스템이 나 레지스트리 같은 일반적인 리소스를 공유 하는 대신 기본적으로 할당 된 파일 영역 자체에 각각 있습니다.

격리된 스토리지를 할당할 때 네 가지 기본 격리 범위가 사용됩니다.

  • User - 코드는 항상 현재 사용자에 따라 범위가 지정됩니다. 동일한 어셈블리는 다른 사용자가 실행할 때 다른 저장소를 받게 됩니다.

  • Machine - 코드는 항상 컴퓨터에 따라 범위가 지정됩니다. 동일한 컴퓨터에서 다른 사용자가 실행할 때 동일한 어셈블리가 동일한 저장소를 받게 됩니다.

  • Assembly- 코드는 강력한 이름(예: Microsoft.Office 또는* Microsoft.Office)으로 암호화하여 식별됩니다. Word), 게시자별(공개 키 기준), URL(예: http://www.fourthcoffee.com/process/grind.htm), 사이트 또는 영역별.

  • Domain 코드는 연결 된 애플리케이션 도메인 증명 정보를 기반으로 식별 됩니다. 웹 애플리케이션 id는 사이트의 URL 또는 웹 페이지의 URL, 사이트 또는 영역에서 파생 됩니다. 로컬 코드 id는 애플리케이션 디렉터리 경로 기반으로 합니다.

URL, 사이트 및 영역에 대한 정의는 다음SiteIdentityPermission을 참조UrlIdentityPermission하세요ZoneIdentityPermission.

이러한 ID는 함께 그룹화되며, 이 경우 원하는 격리된 스토리지가 만들어질 때까지 순차적으로 적용됩니다. 유효한 그룹은 User+Assembly 및 User+Assembly+Domain입니다. 이 그룹화 id의 다양 한 애플리케이션에 유용합니다.

데이터가 도메인, 사용자 및 어셈블리에 의해 저장되는 경우 해당 어셈블리의 코드만 데이터에 액세스할 수 있는 프라이빗 데이터입니다. 데이터 저장소가 실행 되는 애플리케이션 별로 격리 되기도 어셈블리를 다른 애플리케이션에 데이터를 노출 하 여 잠재적인 누수를 나타내지 않도록 합니다.

여러 애플리케이션에서 적용 되는 사용자 데이터에 대 한 어셈블리 및 사용자 격리를 사용할 수 있습니다. 예를 들어, 정보 또는 사용자의 개인 정보 (이름, 인증 자격 증명 및 등)는 애플리케이션의 독립적인 라이선스.

IsolatedStorageContainment 애플리케이션 격리 된 스토리지를 사용 하도록 허용 되는지 여부를 결정 하는 플래그를 노출 및 사용 하는 id 조합을 수, 하는 경우. 또한 정보 (Windows 로밍 사용자 프로필이 나 폴더 리디렉션을 구성 해야 합니다) 사용자와 로밍할 수 있는 위치에 저장 하는 애플리케이션 허용 되는지 여부를 결정 합니다.

적용 대상

추가 정보