IsolatedStorageFilePermissionAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ <AttributeUsageAttribute(AttributeTargets.Assembly Or AttributeTargets.Class Or AttributeTargets.Struct Or AttributeTargets.Constructor Or AttributeTargets.Method, AllowMultiple:=True, Inherited:=False)> _ Public NotInheritable Class IsolatedStorageFilePermissionAttribute Inherits IsolatedStoragePermissionAttribute
[SerializableAttribute] [ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Constructor|AttributeTargets.Method, AllowMultiple=true, Inherited=false)] public sealed class IsolatedStorageFilePermissionAttribute : IsolatedStoragePermissionAttribute
[SerializableAttribute] [ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets::Assembly|AttributeTargets::Class|AttributeTargets::Struct|AttributeTargets::Constructor|AttributeTargets::Method, AllowMultiple=true, Inherited=false)] public ref class IsolatedStorageFilePermissionAttribute sealed : public IsolatedStoragePermissionAttribute
/** @attribute SerializableAttribute() */ /** @attribute ComVisibleAttribute(true) */ /** @attribute AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Constructor|AttributeTargets.Method, AllowMultiple=true, Inherited=false) */ public final class IsolatedStorageFilePermissionAttribute extends IsolatedStoragePermissionAttribute
SerializableAttribute ComVisibleAttribute(true) AttributeUsageAttribute(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Constructor|AttributeTargets.Method, AllowMultiple=true, Inherited=false) public final class IsolatedStorageFilePermissionAttribute extends IsolatedStoragePermissionAttribute

宣言の許容スコープは、使用する SecurityAction によって異なります。
セキュリティ属性によって宣言されたセキュリティ情報は、属性ターゲットのメタデータに格納され、実行時にシステムによってアクセスされます。セキュリティ属性は宣言セキュリティにだけ使用されます。強制セキュリティの場合は、対応するアクセス許可クラスを使用します。

IsolatedStorageFilePermission を要求する正しい方法を示し、コードを実行するためには少なくともこのアクセス許可が必要であり、さらに最大ユーザー クォータが 5 MB 必要であることを次の宣言属性の例に示します。
<Assembly: IsolatedStorageFilePermissionAttribute( _ SecurityAction.RequestMinimum, UserQuota := 5242880)> 'In Visual Basic, you must specify that you are using the assembly scope when making a request.
[assembly:IsolatedStorageFilePermissionAttribute( SecurityAction.RequestMinimum, UserQuota=5242880)] //In C#, you must specify that you are using the assembly scope when making a request.
[assembly:IsolatedStorageFilePermissionAttribute( SecurityAction::RequestMinimum,UserQuota=5242880)]; //In C++, you must specify that you are using the assembly scope when making a request.
/** @assembly IsolatedStorageFilePermissionAttribute(SecurityAction. RequestMinimum, UserQuota = 5242880) */ // In VJ#, you must specify that you are using the assembly scope when making // a request.
リンク時に、呼び出し元のコードに無制限の IsolatedStorageFilePermission を含めることを要求する方法を次の例に示します。通常、メソッドやクラスを不正なコードから保護するための要求がマネージ ライブラリ (DLL) で作成されます。
<IsolatedStorageFilePermissionAttribute( _ SecurityAction.Demand, Unrestricted := True)> _ Public Class SampleClass
/** @attribute IsolatedStorageFilePermissionAttribute(SecurityAction.Demand, Unrestricted = true) */
このアセンブリのコードに 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.Attribute
System.Security.Permissions.SecurityAttribute
System.Security.Permissions.CodeAccessSecurityAttribute
System.Security.Permissions.IsolatedStoragePermissionAttribute
System.Security.Permissions.IsolatedStorageFilePermissionAttribute


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


IsolatedStorageFilePermissionAttribute コンストラクタ
アセンブリ: mscorlib (mscorlib.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


IsolatedStorageFilePermissionAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | Action | セキュリティ アクションを取得または設定します。 ( SecurityAttribute から継承されます。) |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
![]() | Unrestricted | 属性によって保護されているリソースに対して完全な (無制限の) アクセス許可が宣言されているかどうかを示す値を取得または設定します。 ( SecurityAttribute から継承されます。) |
![]() | UsageAllowed | 宣言する必要がある分離ストレージのレベルを取得または設定します。 ( IsolatedStoragePermissionAttribute から継承されます。) |
![]() | UserQuota | ユーザー ストレージ クォータの最大サイズを取得または設定します。 ( IsolatedStoragePermissionAttribute から継承されます。) |

IsolatedStorageFilePermissionAttribute メソッド

名前 | 説明 | |
---|---|---|
![]() | CreatePermission | オーバーライドされます。 新しい IsolatedStorageFilePermission を作成して返します。 |
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

IsolatedStorageFilePermissionAttribute メンバ
宣言セキュリティを使用して、IsolatedStorageFilePermission のセキュリティ アクションをコードに適用できるようにします。このクラスは継承できません。
IsolatedStorageFilePermissionAttribute データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | IsolatedStorageFilePermissionAttribute | SecurityAction を指定して、IsolatedStorageFilePermissionAttribute クラスの新しいインスタンスを初期化します。 |

名前 | 説明 | |
---|---|---|
![]() | Action | セキュリティ アクションを取得または設定します。(SecurityAttribute から継承されます。) |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
![]() | Unrestricted | 属性によって保護されているリソースに対して完全な (無制限の) アクセス許可が宣言されているかどうかを示す値を取得または設定します。(SecurityAttribute から継承されます。) |
![]() | UsageAllowed | 宣言する必要がある分離ストレージのレベルを取得または設定します。(IsolatedStoragePermissionAttribute から継承されます。) |
![]() | UserQuota | ユーザー ストレージ クォータの最大サイズを取得または設定します。(IsolatedStoragePermissionAttribute から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | CreatePermission | オーバーライドされます。 新しい IsolatedStorageFilePermission を作成して返します。 |
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からIsolatedStorageFilePermissionAttributeを検索する場合は、下記のリンクをクリックしてください。

- IsolatedStorageFilePermissionAttributeのページへのリンク