Share via


사용자 및 어셈블리별 격리

데이터 저장소를 사용하는 어셈블리를 응용 프로그램의 도메인에서 액세스할 수 있어야 하는 경우 사용자 및 어셈블리별 격리 방법이 적절합니다. 이런 경우 일반적으로 격리된 저장소는 여러 응용 프로그램 간에 적용되는 데이터를 저장하는 데 사용되며 사용자 이름 또는 라이센스 정보 등의 특정 응용 프로그램에만 국한되지 않습니다. 사용자 및 어셈블리별로 격리된 저장소에 액세스하려면 응용 프로그램 간에 정보를 전송할 수 있도록 코드가 신뢰를 받아야 합니다. 일반적으로 사용자 및 어셈블리별 격리는 인트라넷에서 허용되지만 인터넷에서는 허용되지 않습니다. IsolatedStorageFile의 정적 GetStore 메서드를 호출하고 사용자와 어셈블리 IsolatedStorageScope를 전달하면 이러한 격리 유형의 저장소가 반환됩니다.

다음 코드 예제에서는 사용자 및 어셈블리별로 격리된 저장소를 검색합니다. isoFile 개체를 통해 저장소에 액세스할 수 있습니다.

Dim isoFile As IsolatedStorageFile = _
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or _
        IsolatedStorageScope.Assembly, Nothing, Nothing)
IsolatedStorageFile isoFile =
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
    IsolatedStorageScope.Assembly, null, null);
IsolatedStorageFile^ isoFile =
    IsolatedStorageFile::GetStore(IsolatedStorageScope::User |
        IsolatedStorageScope::Assembly, (Type^)nullptr, (Type^)nullptr);

증명 정보 매개 변수를 사용하는 예제는 IsolatedStorageFile.GetStore(IsolatedStorageScope, Evidence, Type, Evidence, Type)를 참조하십시오.

다음 코드 예제에서와 같이 GetUserStoreForAssembly 메서드를 사용하면 이 작업을 더 빨리 수행할 수 있습니다. 이 메서드는 로밍할 수 있는 저장소를 여는 데는 사용할 수 없으므로 이런 경우에는 GetStore를 사용하십시오.

Dim isoFile As IsolatedStorageFile = _
    IsolatedStorageFile.GetUserStoreForAssembly()
IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForAssembly();
IsolatedStorageFile^ isoFile = IsolatedStorageFile::GetUserStoreForAssembly();

참고 항목

참조

GetUserStoreForAssembly

개념

격리된 저장소

격리 유형

사용자, 도메인 및 어셈블리별 격리