次の方法で共有


IsolatedStorageFile.GetStore メソッド (IsolatedStorageScope, Type, Type)

指定したアプリケーション ドメインとアセンブリの証拠型で指定される分離ストレージ スコープに対応する分離ストレージを取得します。

Overloads Public Shared Function GetStore( _
   ByVal scope As IsolatedStorageScope, _   ByVal domainEvidenceType As Type, _   ByVal assemblyEvidenceType As Type _) As IsolatedStorageFile
[C#]
public static IsolatedStorageFile GetStore(IsolatedStorageScopescope,TypedomainEvidenceType,TypeassemblyEvidenceType);
[C++]
public: static IsolatedStorageFile* GetStore(IsolatedStorageScopescope,Type* domainEvidenceType,Type* assemblyEvidenceType);
[JScript]
public static function GetStore(
   scope : IsolatedStorageScope,domainEvidenceType : Type,assemblyEvidenceType : Type) : IsolatedStorageFile;

パラメータ

  • scope
    IsolatedStorageScope 値のビットごとの組み合わせ。
  • domainEvidenceType
    呼び出し元のアプリケーションのドメインに存在する Evidence の一覧から選択できる Evidence の種類。 null 参照 (Visual Basic では Nothing) を使用すると、 IsolatedStorage が自動的に証拠を選択します。
  • assemblyEvidenceType
    呼び出し元のアプリケーションのドメインに存在する Evidence の一覧から選択できる Evidence の種類。 null 参照 (Visual Basic では Nothing) を使用すると、 IsolatedStorage が自動的に証拠を選択します。

戻り値

指定したパラメータを表す IsolatedStorageFile

例外

例外の種類 条件
SecurityException 分離ストレージに対して必要なアクセス許可が与えられていません。
ArgumentException scope が無効です。
IsolatedStorageException 指定された evidenceType は、アセンブリの証拠リストに存在しません。

解説

これは通常アプリケーション コードから呼び出される GetStore のオーバーロードです。

この GetStore のオーバーロードは、渡された証拠型に対応する分離ストアを開きます。

Note[note]: scopeDomain であり、アセンブリがインストールされているアプリケーション ドメインが IsolatedStorageFilePermission を持たない場合、 GetStore はクォータを指定せずに IsolatedStorageFile を返します。クォータを持たない IsolatedStorageFile を使用して IsolatedStorageFile オブジェクトを後で作成しようとすると、 IsolatedStorageException が発生して失敗します。

使用例

[Visual Basic, C#, C++] GetStore メソッドについては、次のコード例を参照してください。この例のコンテキスト全体については、 IsolatedStorageFile の概要を参照してください。

 
' 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++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

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

.NET Framework セキュリティ:

参照

IsolatedStorageFile クラス | IsolatedStorageFile メンバ | System.IO.IsolatedStorage 名前空間 | IsolatedStorageFile.GetStore オーバーロードの一覧