IsolatedStorageFile.GetStore 메서드

정의

지정된 애플리케이션 도메인 및 어셈블리 증명 정보 개체와 일치하는 격리된 스토리지 및 격리된 스토리지 범위를 가져옵니다.

오버로드

GetStore(IsolatedStorageScope, Object)

지정된 애플리케이션 ID에 해당하는 격리된 스토리지를 가져옵니다.

GetStore(IsolatedStorageScope, Type)

격리 범위와 애플리케이션 ID 개체에 해당하는 격리된 스토리지를 가져옵니다.

GetStore(IsolatedStorageScope, Object, Object)

지정된 애플리케이션 도메인 및 어셈블리 증명 정보 개체와 일치하는 격리된 스토리지를 가져옵니다.

GetStore(IsolatedStorageScope, Type, Type)

애플리케이션 도메인 및 어셈블리 증명 정보 형식이 지정된 경우 격리된 스토리지 범위에 해당하는 격리된 스토리지를 가져옵니다.

GetStore(IsolatedStorageScope, Evidence, Type, Evidence, Type)

지정된 애플리케이션 도메인, 어셈블리 증명 정보 개체, 그리고 형식과 일치하는 격리된 스토리지를 가져옵니다.

GetStore(IsolatedStorageScope, Object)

Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs

지정된 애플리케이션 ID에 해당하는 격리된 스토리지를 가져옵니다.

public:
 static System::IO::IsolatedStorage::IsolatedStorageFile ^ GetStore(System::IO::IsolatedStorage::IsolatedStorageScope scope, System::Object ^ applicationIdentity);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, object? applicationIdentity);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, object applicationIdentity);
static member GetStore : System.IO.IsolatedStorage.IsolatedStorageScope * obj -> System.IO.IsolatedStorage.IsolatedStorageFile
Public Shared Function GetStore (scope As IsolatedStorageScope, applicationIdentity As Object) As IsolatedStorageFile

매개 변수

scope
IsolatedStorageScope

열거형 값의 비트 조합입니다.

applicationIdentity
Object

애플리케이션 ID에 대한 증명 정보가 들어 있는 개체입니다.

반환

매개 변수를 나타내는 개체입니다.

예외

격리된 스토리지 권한이 충분히 부여되지 않은 경우.

ID가 applicationIdentity 전달되지 않았습니다.

scope가 잘못되었습니다.

격리된 스토리지 위치를 초기화할 수 없습니다.

또는

scope 에는 열거형 값 Application이 포함되어 있지만 호출자의 애플리케이션 ID를 확인할 수 없습니다. 현재 애플리케이션 도메인에 대한 가 ActivationContext 를 반환 null했기 때문입니다.

또는

scope에는 값 Domain이 포함되어 있지만 애플리케이션 도메인 사용 권한을 확인할 수 없습니다.

또는

scope에는 값 Assembly이 포함되어 있지만 호출 어셈블리 사용 권한을 확인할 수 없습니다.

설명

참고

경우는 scope 매개 변수는 IsolatedStorageScope.Application 어셈블리를 설치 하는 애플리케이션 도메인에 없는 IsolatedStorageFilePermissionGetStore 메서드는 반환는 IsolatedStorageFile 할당량 없이 개체. 나중에 할당량이 없는 개체를 IsolatedStorageFile 사용하여 개체를 IsolatedStorageFile 만들려고 하면 와 함께 IsolatedStorageException실패합니다.

추가 정보

적용 대상

GetStore(IsolatedStorageScope, Type)

Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs

격리 범위와 애플리케이션 ID 개체에 해당하는 격리된 스토리지를 가져옵니다.

public:
 static System::IO::IsolatedStorage::IsolatedStorageFile ^ GetStore(System::IO::IsolatedStorage::IsolatedStorageScope scope, Type ^ applicationEvidenceType);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, Type? applicationEvidenceType);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, Type applicationEvidenceType);
static member GetStore : System.IO.IsolatedStorage.IsolatedStorageScope * Type -> System.IO.IsolatedStorage.IsolatedStorageFile
Public Shared Function GetStore (scope As IsolatedStorageScope, applicationEvidenceType As Type) As IsolatedStorageFile

매개 변수

scope
IsolatedStorageScope

열거형 값의 비트 조합입니다.

applicationEvidenceType
Type

애플리케이션 ID가 들어 있는 개체입니다.

반환

매개 변수를 나타내는 개체입니다.

예외

격리된 스토리지 권한이 충분히 부여되지 않은 경우.

ID가 applicationEvidence 전달되지 않았습니다.

scope가 잘못되었습니다.

격리된 스토리지 위치를 초기화할 수 없습니다.

또는

scope에는 열거형 값 Application이 포함되어 있지만 호출자의 애플리케이션 ID를 확인할 수 없습니다. 현재 애플리케이션 도메인에 대한 가 를 반환null했기 때문 ActivationContext 입니다.

또는

scope에는 값 Domain이 포함되어 있지만 애플리케이션 도메인 사용 권한을 확인할 수 없습니다.

또는

scope에는 값 Assembly이 포함되어 있지만 호출 어셈블리 사용 권한을 확인할 수 없습니다.

설명

참고

경우는 scope 매개 변수는 Application 어셈블리를 설치 하는 애플리케이션 도메인에 없는 IsolatedStorageFilePermissionGetStore 메서드는 반환는 IsolatedStorageFile 할당량 없이 개체. 나중에 할당량이 없는 개체를 IsolatedStorageFile 사용하여 개체를 IsolatedStorageFile 만들려고 하면 와 함께 IsolatedStorageException실패합니다.

추가 정보

적용 대상

GetStore(IsolatedStorageScope, Object, Object)

Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs

지정된 애플리케이션 도메인 및 어셈블리 증명 정보 개체와 일치하는 격리된 스토리지를 가져옵니다.

public:
 static System::IO::IsolatedStorage::IsolatedStorageFile ^ GetStore(System::IO::IsolatedStorage::IsolatedStorageScope scope, System::Object ^ domainIdentity, System::Object ^ assemblyIdentity);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, object? domainIdentity, object? assemblyIdentity);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, object domainIdentity, object assemblyIdentity);
static member GetStore : System.IO.IsolatedStorage.IsolatedStorageScope * obj * obj -> System.IO.IsolatedStorage.IsolatedStorageFile
Public Shared Function GetStore (scope As IsolatedStorageScope, domainIdentity As Object, assemblyIdentity As Object) As IsolatedStorageFile

매개 변수

scope
IsolatedStorageScope

열거형 값의 비트 조합입니다.

domainIdentity
Object

애플리케이션 도메인 ID에 대한 증명 정보가 포함된 개체입니다.

assemblyIdentity
Object

코드 어셈블리 ID에 대한 증명 정보가 포함된 개체입니다.

반환

매개 변수를 나타내는 개체입니다.

예외

격리된 스토리지 권한이 충분히 부여되지 않은 경우.

domainIdentityassemblyIdentity 모두 전달되지 않았습니다. 올바른 생성자가 사용되고 있는지 확인합니다.

또는

domainIdentity 또는 assemblyIdentitynull인 경우

scope가 잘못되었습니다.

격리된 스토리지 위치를 초기화할 수 없습니다.

또는

scope에는 열거형 값 Application이 포함되어 있지만 호출자의 애플리케이션 ID를 확인할 수 없습니다. 현재 애플리케이션 도메인에 대한 가 를 반환null했기 때문 ActivationContext 입니다.

또는

scope에는 값 Domain이 포함되어 있지만 애플리케이션 도메인 사용 권한을 확인할 수 없습니다.

또는

scope에는 값 Assembly이 포함되어 있지만 호출 어셈블리 사용 권한을 확인할 수 없습니다.

설명

이 형식 GetStore 은 다른 어셈블리인 것처럼 저장소를 열어야 하는 관리 코드에 가장 유용합니다. 현재 실행 중인 어셈블리가 아닌 제공된 증명 정보에 대해 저장소가 열립니다.

참고

경우는 scope 매개 변수는 Domain 어셈블리를 설치 하는 애플리케이션 도메인에 없는 IsolatedStorageFilePermissionGetStore 메서드는 반환는 IsolatedStorageFile 할당량 없이 개체. 나중에 할당량이 없는 개체를 IsolatedStorageFile 사용하여 개체를 IsolatedStorageFile 만들려고 하면 와 함께 IsolatedStorageException실패합니다.

추가 정보

적용 대상

GetStore(IsolatedStorageScope, Type, Type)

Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs
Source:
IsolatedStorageFile.cs

애플리케이션 도메인 및 어셈블리 증명 정보 형식이 지정된 경우 격리된 스토리지 범위에 해당하는 격리된 스토리지를 가져옵니다.

public:
 static System::IO::IsolatedStorage::IsolatedStorageFile ^ GetStore(System::IO::IsolatedStorage::IsolatedStorageScope scope, Type ^ domainEvidenceType, Type ^ assemblyEvidenceType);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, Type? domainEvidenceType, Type? assemblyEvidenceType);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType);
static member GetStore : System.IO.IsolatedStorage.IsolatedStorageScope * Type * Type -> System.IO.IsolatedStorage.IsolatedStorageFile
Public Shared Function GetStore (scope As IsolatedStorageScope, domainEvidenceType As Type, assemblyEvidenceType As Type) As IsolatedStorageFile

매개 변수

scope
IsolatedStorageScope

열거형 값의 비트 조합입니다.

domainEvidenceType
Type

호출하는 애플리케이션의 도메인에 있는 Evidence 목록에서 선택할 수 있는 Evidence의 형식입니다. null을 사용하면 IsolatedStorage 개체가 증명 정보를 선택할 수 있습니다.

assemblyEvidenceType
Type

호출하는 애플리케이션의 도메인에 있는 Evidence 목록에서 선택할 수 있는 Evidence의 형식입니다. null을 사용하면 IsolatedStorage 개체가 증명 정보를 선택할 수 있습니다.

반환

매개 변수를 나타내는 개체입니다.

예외

격리된 스토리지 권한이 충분히 부여되지 않은 경우.

scope가 잘못되었습니다.

제공된 증명 정보 형식이 어셈블리 증명 정보 목록에 없습니다.

또는

격리된 스토리지 위치를 초기화할 수 없습니다.

또는

scope에는 열거형 값 Application이 포함되어 있지만 호출자의 애플리케이션 ID를 확인할 수 없습니다. 현재 애플리케이션 도메인에 대한 가 를 반환null했기 때문 ActivationContext 입니다.

또는

scope에는 값 Domain이 포함되어 있지만 애플리케이션 도메인 사용 권한을 확인할 수 없습니다.

또는

scope에는 Assembly이 포함되어 있지만 호출 어셈블리 사용 권한을 확인할 수 없습니다.

예제

다음 코드 예제는 GetStore 메서드. 이 예제의 전체 컨텍스트는 개요를 참조하세요 IsolatedStorageFile .

// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile^ isoFile = IsolatedStorageFile::GetStore( static_cast<IsolatedStorageScope>(IsolatedStorageScope::User | IsolatedStorageScope::Assembly | IsolatedStorageScope::Domain), (Type^)nullptr, nullptr );
IsolatedStorageFileStream^ isoStream = gcnew IsolatedStorageFileStream( this->userName,FileMode::Open,FileAccess::ReadWrite,isoFile );

// 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("substituteUsername",
    System.IO.FileMode.Open,
    System.IO.FileAccess.Read,
     System.IO.FileShare.Read);
' 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("substituteUsername", System.IO.FileMode.Open, _
    System.IO.FileAccess.Read, System.IO.FileShare.Read)

설명

이 오버 로드는 GetStore 가능성이 가장 높은 애플리케이션 코드에서 호출할 수 있습니다.

이 오버로드는 GetStore 전달되는 증거 유형에 대한 격리된 저장소를 엽니다.

참고

경우는 scope 매개 변수는 Domain 어셈블리를 설치 하는 애플리케이션 도메인에 없는 IsolatedStorageFilePermissionGetStore 메서드는 반환는 IsolatedStorageFile 할당량 없이 개체. 나중에 할당량이 없는 개체를 IsolatedStorageFile 사용하여 개체를 IsolatedStorageFile 만들려는 시도는 와 함께 IsolatedStorageException실패합니다.

추가 정보

적용 대상

GetStore(IsolatedStorageScope, Evidence, Type, Evidence, Type)

지정된 애플리케이션 도메인, 어셈블리 증명 정보 개체, 그리고 형식과 일치하는 격리된 스토리지를 가져옵니다.

public:
 static System::IO::IsolatedStorage::IsolatedStorageFile ^ GetStore(System::IO::IsolatedStorage::IsolatedStorageScope scope, System::Security::Policy::Evidence ^ domainEvidence, Type ^ domainEvidenceType, System::Security::Policy::Evidence ^ assemblyEvidence, Type ^ assemblyEvidenceType);
public static System.IO.IsolatedStorage.IsolatedStorageFile GetStore (System.IO.IsolatedStorage.IsolatedStorageScope scope, System.Security.Policy.Evidence domainEvidence, Type domainEvidenceType, System.Security.Policy.Evidence assemblyEvidence, Type assemblyEvidenceType);
static member GetStore : System.IO.IsolatedStorage.IsolatedStorageScope * System.Security.Policy.Evidence * Type * System.Security.Policy.Evidence * Type -> System.IO.IsolatedStorage.IsolatedStorageFile
Public Shared Function GetStore (scope As IsolatedStorageScope, domainEvidence As Evidence, domainEvidenceType As Type, assemblyEvidence As Evidence, assemblyEvidenceType As Type) As IsolatedStorageFile

매개 변수

scope
IsolatedStorageScope

열거형 값의 비트 조합입니다.

domainEvidence
Evidence

애플리케이션 도메인 ID가 포함된 개체입니다.

domainEvidenceType
Type

애플리케이션 도메인 증명 정보에서 선택할 ID 형식입니다.

assemblyEvidence
Evidence

코드 어셈블리 ID가 포함된 개체입니다.

assemblyEvidenceType
Type

애플리케이션 코드 어셈블리 증명 정보에서 선택할 ID 형식입니다.

반환

매개 변수를 나타내는 개체입니다.

예외

격리된 스토리지 권한이 충분히 부여되지 않은 경우.

domainEvidence 또는 assemblyEvidence ID가 전달되지 않은 경우

scope가 잘못되었습니다.

격리된 스토리지 위치를 초기화할 수 없습니다.

또는

scope에는 열거형 값Application이 포함되어 있지만 호출자의 애플리케이션 ID를 확인할 수 없습니다. 현재 애플리케이션 도메인에 대한 가 를 반환null했기 때문 ActivationContext 입니다.

또는

scope에는 값 Domain이 포함되어 있지만 애플리케이션 도메인 사용 권한을 확인할 수 없습니다.

또는

scope에는 값 Assembly이 포함되어 있지만 호출 어셈블리 사용 권한을 확인할 수 없습니다.

예제

다음 코드 예제는 게시자 증명 정보에 따라 스토리지를 가져옵니다.

using System;
using System.IO;
using System.IO.IsolatedStorage;
using System.Security;
using System.Security.Policy;
using System.Security.Permissions;
using System.Security.Cryptography.X509Certificates;

class Program
{
    static void Main(string[] args)
    {
        try
        {

            if (Test())
            {
                Console.WriteLine("PASSED.");
                Environment.ExitCode = 100;
            }
            else
            {
                Console.WriteLine("FAILED.");
                Environment.ExitCode = 101;
            }
        }
        catch (Exception e)
        {
            Console.Write("Exception occurred: {0}", e.ToString());
            Environment.ExitCode = 101;
        }
        return;
    }

    public static Boolean Test()
    {
        Boolean bRes = true;

        Evidence evidence1 = GetTestEvidence();
        Evidence evidence2 = GetTestEvidence();

        IsolatedStorageFile isf = IsolatedStorageFile.GetStore(
                                    IsolatedStorageScope.User | IsolatedStorageScope.Assembly,
                                    evidence1,
                                    typeof(System.Security.Policy.Publisher),
                                    evidence2,
                                    typeof(System.Security.Policy.Publisher));

        IsolatedStorageFileStream isfs = new IsolatedStorageFileStream("AdminEvd1.testfile", FileMode.OpenOrCreate, isf);
        isfs.WriteByte(5);
        isfs.Flush();
        isfs.Close();

        return bRes;
    }

    public static Evidence GetTestEvidence()
    {
        // For demonsration purposes, use a blank certificate.
        Publisher pub = new Publisher(new X509Certificate(new Byte[64]));
        Object[] arrObj = new Object[1];
        arrObj[0] = (Object)pub;
        return new Evidence(arrObj, arrObj);
    }
}
Imports System.IO
Imports System.IO.IsolatedStorage
Imports System.Security
Imports System.Security.Policy
Imports System.Security.Permissions
Imports System.Security.Cryptography.X509Certificates

Class Program

    Public Shared Sub Main(ByVal args() As String)
        Try
            If Test Then
                Console.WriteLine("PASSED.")
                Environment.ExitCode = 100
            Else
                Console.WriteLine("FAILED.")
                Environment.ExitCode = 101
            End If
        Catch e As Exception
            Console.Write("Exception occurred: {0}", e.ToString)
            Environment.ExitCode = 101
        End Try
        Return
    End Sub

    Public Shared Function Test() As Boolean
        Dim bRes As Boolean = True
        Dim evidence1 As Evidence = GetTestEvidence
        Dim evidence2 As Evidence = GetTestEvidence
        Dim isf As IsolatedStorageFile = IsolatedStorageFile.GetStore((IsolatedStorageScope.User _
         Or IsolatedStorageScope.Assembly), _
         evidence1, _
         GetType(System.Security.Policy.Publisher), _
         evidence2, _
         GetType(System.Security.Policy.Publisher))
        Dim isfs As IsolatedStorageFileStream = New IsolatedStorageFileStream("AdminEvd1.testfile", _
         FileMode.OpenOrCreate, isf)
        isfs.WriteByte(5)
        isfs.Flush()
        isfs.Close()
        Return bRes
    End Function

    Public Shared Function GetTestEvidence() As Evidence

        ' For demonsration purposes, use a blank certificate.
        Dim CertTemp(63) As Byte
        Dim pub As Publisher = New Publisher(New X509Certificate(CertTemp))
        Dim arrObj(0) As Object
        arrObj(0) = CType(pub, Object)
        Return New Evidence(arrObj, arrObj)
    End Function
End Class

설명

참고

경우는 scope 매개 변수는 Domain 어셈블리를 설치 하는 애플리케이션 도메인에 없는 IsolatedStorageFilePermissionGetStore 메서드는 반환는 IsolatedStorageFile 할당량 없이 개체. 나중에 할당량이 없는 개체를 IsolatedStorageFile 사용하여 개체를 IsolatedStorageFile 만들려는 시도는 와 함께 IsolatedStorageException실패합니다.

추가 정보

적용 대상