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

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

宣言の許容スコープは、使用する SecurityAction によって異なります。
セキュリティ属性によって宣言されたセキュリティ情報は、属性ターゲットのメタデータに格納され、実行時にシステムによってアクセスされます。セキュリティ属性は宣言セキュリティにだけ使用されます。強制セキュリティの場合は、対応するアクセス許可クラスを使用します。
環境変数名では、大文字と小文字は区別されません。複数の環境変数名は、PathSeparator を使用して、それぞれの名前を区切って指定します。

指定した環境変数を読み取る機能のために EnvironmentPermission を要求する正しい方法を示し、コードを実行するためには少なくともこのアクセス許可が必要であることを次の宣言属性の例に示します。
<Assembly: EnvironmentPermissionAttribute(SecurityAction.RequestMinimum, _ Read := "COMPUTERNAME;USERNAME;USERDOMAIN")> 'In Visual Basic, you must specify that you are using the assembly scope when making a request.
[assembly:EnvironmentPermissionAttribute(SecurityAction.RequestMinimum, Read="COMPUTERNAME;USERNAME;USERDOMAIN")] //In C#, you must specify that you are using the assembly scope when making a request.
[assembly:EnvironmentPermissionAttribute(SecurityAction::RequestMinimum, Read="COMPUTERNAME;USERNAME;USERDOMAIN")]; //In C++, you must specify that you are using the assembly scope when making a request.
/** @assembly EnvironmentPermissionAttribute(SecurityAction.RequestMinimum, Read = "COMPUTERNAME;USERNAME;USERDOMAIN") */ // In VJ#, you must specify that you are using the assembly scope when // making a request.
リンク時に呼び出し元コードに EnvironmentPermission を要求する方法を次の例に示します。通常、メソッドやクラスを不正なコードから保護するための要求がマネージ ライブラリ (DLL) で作成されます。

System.Attribute
System.Security.Permissions.SecurityAttribute
System.Security.Permissions.CodeAccessSecurityAttribute
System.Security.Permissions.EnvironmentPermissionAttribute


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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



' This sample demonstrates the use of the EnvironmentPermissionAttribute. Imports System Imports System.Reflection Imports System.Security.Permissions Imports System.Security Imports System.IO Imports Microsoft.VisualBasic Class [MyClass] Public Shared Sub PermissionDemo() Try PermitOnlyMethod() Catch e As Exception Console.WriteLine(e.Message.ToString()) End Try Try DenyMethod() Catch e As Exception Console.WriteLine(e.Message.ToString()) End Try Try DenyAllMethod() Catch e As Exception Console.WriteLine(e.Message.ToString()) End Try End Sub 'PermissionDemo ' This method demonstrates the use of the EnvironmentPermissionAttribute to create a PermitOnly permission. ' Set the Read property for a PermitOnly SecurityAction. ' Set the All property for a PermitOnly SecurityAction. ' Set the Read, All, and Write properties. <EnvironmentPermissionAttribute(SecurityAction.PermitOnly, Read:="COMPUTERNAME"), _ EnvironmentPermissionAttribute(SecurityAction.PermitOnly, All:="USERNAME"), _ EnvironmentPermissionAttribute(SecurityAction.PermitOnly, Write:="USERDOMAIN")> _ Public Shared Sub PermitOnlyMethod() Console.WriteLine("Executing PermitOnlyMethod.") Console.WriteLine("PermitOnly the Read permission for COMPUTERNAME.") Console.WriteLine("PermitOnly the All permission for USERNAME.") Console.WriteLine("PermitOnly the Write permission for USERDOMAIN.") PermitOnlyTest() End Sub 'PermitOnlyMethod Public Shared Sub PermitOnlyTest() Console.WriteLine("Executing PermitOnlyTest.") Try Dim ps As New PermissionSet(PermissionState.None) ps.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME")) Console.WriteLine("Demanding permission to read USERNAME.") ps.Demand() Console.WriteLine("Demand succeeded.") ps.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Write, "COMPUTERNAME")) Console.WriteLine("Demanding permission to write COMPUTERNAME.") ' This demand should cause an exception. ps.Demand() ' The TestFailed method is called if an exception is not thrown. TestFailed() Catch e As Exception Console.WriteLine(("An exception was thrown because of a write demand: " & e.Message)) End Try End Sub 'PermitOnlyTest ' This method demonstrates the use of the EnvironmentPermission attribute to deny a permission. <EnvironmentPermissionAttribute(SecurityAction.Deny, Read:="USERNAME")> _ Public Shared Sub DenyMethod() Console.WriteLine("Executing DenyMethod.") Console.WriteLine("Denying the Read permission for USERNAME.") DenyTestMethod() End Sub 'DenyMethod Public Shared Sub DenyTestMethod() Console.WriteLine("Executing DenyTestMethod.") Try Dim ps As New PermissionSet(PermissionState.None) ps.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Read, "COMPUTERNAME")) Console.WriteLine("Demanding permission to read COMPUTERNAME.") ps.Demand() Console.WriteLine("Demand succeeded.") ps.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME")) Console.WriteLine("Demanding permission to read USERNAME.") ' This demand should cause an exception. ps.Demand() ' The TestFailed method is called if an exception is not thrown. TestFailed() Catch e As Exception Console.WriteLine(("An exception was thrown because of a read demand: " & e.Message)) End Try End Sub 'DenyTestMethod ' This method demonstrates the use of the EnvironmentPermissionAttribute to deny all permissions. <EnvironmentPermissionAttribute(SecurityAction.Deny, Unrestricted:=True)> _ Public Shared Sub DenyAllMethod() Console.WriteLine("Executing DenyAllMethod.") Console.WriteLine("Denied all EnvironmentPermissions") DenyAllTestMethod() End Sub 'DenyAllMethod ' This method tests to assure permissions have been denied. Public Shared Sub DenyAllTestMethod() Console.WriteLine("Executing DenyAllTestMethod.") Try Dim ps As New PermissionSet(PermissionState.None) ps.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Read, "COMPUTERNAME")) Console.WriteLine("Demanding permission to read 'COMPUTERNAME'.") ' This demand should cause an exception. ps.Demand() ' The TestFailed method is called if the expected exception is not thrown. TestFailed() Catch e As Exception Console.WriteLine(("An exception was thrown because of a read demand: " + e.Message)) End Try End Sub 'DenyAllTestMethod Public Shared Sub TestFailed() Console.WriteLine("Executing TestFailed method.") Console.WriteLine("Throwing an exception.") Throw New Exception() End Sub 'TestFailed Overloads Shared Sub Main(ByVal args() As String) PermissionDemo() End Sub 'Main End Class '[MyClass]
// This sample demonstrates the use of the EnvironmentPermissionAttribute. using System; using System.Reflection; using System.Security.Permissions; using System.Security; using System.IO; class MyClass { public static void PermissionDemo() { try { PermitOnlyMethod(); } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } try { DenyMethod(); } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } try { DenyAllMethod(); } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } } // This method demonstrates the use of the EnvironmentPermissionAttribute to create a PermitOnly permission. // Set the Read property for a PermitOnly SecurityAction. [EnvironmentPermissionAttribute(SecurityAction.PermitOnly, Read = "COMPUTERNAME")] // Set the All property for a PermitOnly SecurityAction. [EnvironmentPermissionAttribute(SecurityAction.PermitOnly, All = "USERNAME")] // Set the Write property for a PermitOnly SecurityAction. [EnvironmentPermissionAttribute(SecurityAction.PermitOnly, Write = "USERDOMAIN")] public static void PermitOnlyMethod() { Console.WriteLine("Executing PermitOnlyMethod."); Console.WriteLine("PermitOnly the Read permission for COMPUTERNAME."); Console.WriteLine("PermitOnly the All permission for USERNAME."); Console.WriteLine("PermitOnly the Write permission for USERDOMAIN."); PermitOnlyTest(); } public static void PermitOnlyTest() { Console.WriteLine("Executing PermitOnlyTest."); try { PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission( new EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME")); Console.WriteLine("Demanding permission to read USERNAME."); ps.Demand(); Console.WriteLine("Demand succeeded."); ps.AddPermission( new EnvironmentPermission(EnvironmentPermissionAccess.Write, "COMPUTERNAME")); Console.WriteLine("Demanding permission to write COMPUTERNAME."); // This demand should cause an exception. ps.Demand(); // The TestFailed method is called if an exception is not thrown. TestFailed(); } catch (Exception e) { Console.WriteLine("An exception was thrown because of a write demand: " + e.Message); } } // This method demonstrates the use of the EnvironmentPermission attribute to deny a permission. [EnvironmentPermissionAttribute(SecurityAction.Deny, Read = "USERNAME")] public static void DenyMethod() { Console.WriteLine("Executing DenyMethod."); Console.WriteLine("Denying the Read permission for USERNAME."); DenyTestMethod(); } public static void DenyTestMethod() { Console.WriteLine("Executing DenyTestMethod."); try { PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission( new EnvironmentPermission(EnvironmentPermissionAccess.Read, "COMPUTERNAME")); Console.WriteLine("Demanding permission to read COMPUTERNAME."); ps.Demand(); Console.WriteLine("Demand succeeded."); ps.AddPermission( new EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME")); Console.WriteLine("Demanding permission to read USERNAME."); // This demand should cause an exception. ps.Demand(); // The TestFailed method is called if an exception is not thrown. TestFailed(); } catch (Exception e) { Console.WriteLine("An exception was thrown because of a read demand: " + e.Message); } } // This method demonstrates the use of the EnvironmentPermissionAttribute to deny all permissions. [EnvironmentPermissionAttribute(SecurityAction.Deny, Unrestricted = true)] public static void DenyAllMethod() { Console.WriteLine("Executing DenyAllMethod."); Console.WriteLine("Denied all EnvironmentPermissions"); DenyAllTestMethod(); } // This method tests to assure permissions have been denied. public static void DenyAllTestMethod() { Console.WriteLine("Executing DenyAllTestMethod."); try { PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission( new EnvironmentPermission(EnvironmentPermissionAccess.Read, "COMPUTERNAME")); Console.WriteLine("Demanding permission to read 'COMPUTERNAME'."); // This demand should cause an exception. ps.Demand(); // The TestFailed method is called if the expected exception is not thrown. TestFailed(); } catch (Exception e) { Console.WriteLine("An exception was thrown because of a read demand: " + e.Message); } } public static void TestFailed() { Console.WriteLine("Executing TestFailed method."); Console.WriteLine("Throwing an exception."); throw new Exception(); } static void Main(string[] args) { PermissionDemo(); } }
// This sample demonstrates the use of the EnvironmentPermissionAttribute. using namespace System; using namespace System::Reflection; using namespace System::Security::Permissions; using namespace System::Security; using namespace System::IO; void TestFailed() { Console::WriteLine( "Executing TestFailed method." ); Console::WriteLine( "Throwing an exception." ); throw gcnew Exception; } void PermitOnlyTest() { Console::WriteLine( "Executing PermitOnlyTest." ); try { PermissionSet^ ps = gcnew PermissionSet( PermissionState::None ); ps->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Read,"USERNAME" ) ); Console::WriteLine( "Demanding permission to read USERNAME." ); ps->Demand(); Console::WriteLine( "Demand succeeded." ); ps->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Write,"COMPUTERNAME" ) ); Console::WriteLine( "Demanding permission to write COMPUTERNAME." ); // This demand should cause an exception. ps->Demand(); // The TestFailed method is called if an exception is not thrown. TestFailed(); } catch ( Exception^ e ) { Console::WriteLine( "An exception was thrown because of a write demand: {0}", e->Message ); } } // This function demonstrates the use of the EnvironmentPermissionAttribute to create a PermitOnly permission. // Set the Read property for a PermitOnly SecurityAction. [EnvironmentPermissionAttribute(SecurityAction::PermitOnly,Read="COMPUTERNAME")] // Set the All property for a PermitOnly SecurityAction. [EnvironmentPermissionAttribute(SecurityAction::PermitOnly,All="USERNAME")] // Set the Write property for a PermitOnly SecurityAction. [EnvironmentPermissionAttribute(SecurityAction::PermitOnly,Write="USERDOMAIN")] void PermitOnlyMethod() { Console::WriteLine( "Executing PermitOnlyMethod." ); Console::WriteLine( "PermitOnly the Read permission for COMPUTERNAME." ); Console::WriteLine( "PermitOnly the All permission for USERNAME." ); Console::WriteLine( "PermitOnly the Write permission for USERDOMAIN." ); PermitOnlyTest(); } void DenyTestMethod() { Console::WriteLine( "Executing DenyTestMethod." ); try { PermissionSet^ ps = gcnew PermissionSet( PermissionState::None ); ps->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Read,"COMPUTERNAME" ) ); Console::WriteLine( "Demanding permission to read COMPUTERNAME." ); ps->Demand(); Console::WriteLine( "Demand succeeded." ); ps->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Read,"USERNAME" ) ); Console::WriteLine( "Demanding permission to read USERNAME." ); // This demand should cause an exception. ps->Demand(); // The TestFailed method is called if an exception is not thrown. TestFailed(); } catch ( Exception^ e ) { Console::WriteLine( "An exception was thrown because of a read demand: {0}", e->Message ); } } // This method demonstrates the use of the EnvironmentPermission attribute to deny a permission. [EnvironmentPermissionAttribute(SecurityAction::Deny,Read="USERNAME")] void DenyMethod() { Console::WriteLine( "Executing DenyMethod." ); Console::WriteLine( "Denying the Read permission for USERNAME." ); DenyTestMethod(); } void PermissionDemo() { try { PermitOnlyMethod(); } catch ( Exception^ e ) { Console::WriteLine( e->Message ); } try { DenyMethod(); } catch ( Exception^ e ) { Console::WriteLine( e->Message ); } } int main() { PermissionDemo(); }
// This sample demonstrates the use of the EnvironmentPermissionAttribute. import System.*; import System.Reflection.*; import System.Security.Permissions.*; import System.Security.*; import System.IO.*; class MyClass { public static void PermissionDemo() { try { PermitOnlyMethod(); } catch (System.Exception e) { Console.WriteLine(e.get_Message().toString()); } try { DenyMethod(); } catch (System.Exception e) { Console.WriteLine(e.get_Message().toString()); } try { DenyAllMethod(); } catch (System.Exception e) { Console.WriteLine(e.get_Message().toString()); } } //PermissionDemo // This method demonstrates the use of the EnvironmentPermissionAttribute to // create a PermitOnly permission. // Set the Read property for a PermitOnly SecurityAction. /** @attribute EnvironmentPermissionAttribute(SecurityAction.PermitOnly, Read = "COMPUTERNAME") */ // Set the All property for a PermitOnly SecurityAction. /** @attribute EnvironmentPermissionAttribute(SecurityAction.PermitOnly, All = "USERNAME") */ // Set the Write property for a PermitOnly SecurityAction. /** @attribute EnvironmentPermissionAttribute(SecurityAction.PermitOnly, Write = "USERDOMAIN") */ public static void PermitOnlyMethod() { Console.WriteLine("Executing PermitOnlyMethod."); Console.WriteLine("PermitOnly the Read permission for COMPUTERNAME."); Console.WriteLine("PermitOnly the All permission for USERNAME."); Console.WriteLine("PermitOnly the Write permission for USERDOMAIN."); PermitOnlyTest(); } //PermitOnlyMethod public static void PermitOnlyTest() { Console.WriteLine("Executing PermitOnlyTest."); try { PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission(new EnvironmentPermission( EnvironmentPermissionAccess.Read, "USERNAME")); Console.WriteLine("Demanding permission to read USERNAME."); ps.Demand(); Console.WriteLine("Demand succeeded."); ps.AddPermission(new EnvironmentPermission( EnvironmentPermissionAccess.Write, "COMPUTERNAME")); Console.WriteLine("Demanding permission to write COMPUTERNAME."); // This demand should cause an exception. ps.Demand(); // The TestFailed method is called if an exception is not thrown. TestFailed(); } catch (System.Exception e) { Console.WriteLine(("An exception was thrown because of a " + "write demand: " + e.get_Message())); } } //PermitOnlyTest // This method demonstrates the use of the EnvironmentPermission // attribute to deny a permission. /** @attribute EnvironmentPermissionAttribute (SecurityAction.Deny, Read = "USERNAME") */ public static void DenyMethod() { Console.WriteLine("Executing DenyMethod."); Console.WriteLine("Denying the Read permission for USERNAME."); DenyTestMethod(); } //DenyMethod public static void DenyTestMethod() { Console.WriteLine("Executing DenyTestMethod."); try { PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission(new EnvironmentPermission( EnvironmentPermissionAccess.Read, "COMPUTERNAME")); Console.WriteLine("Demanding permission to read COMPUTERNAME."); ps.Demand(); Console.WriteLine("Demand succeeded."); ps.AddPermission(new EnvironmentPermission( EnvironmentPermissionAccess.Read, "USERNAME")); Console.WriteLine("Demanding permission to read USERNAME."); // This demand should cause an exception. ps.Demand(); // The TestFailed method is called if an exception is not thrown. TestFailed(); } catch (System.Exception e) { Console.WriteLine(("An exception was thrown because of " + "a read demand: " + e.get_Message())); } } //DenyTestMethod // This method demonstrates the use of the //EnvironmentPermissionAttribute to deny all permissions. /** @attribute EnvironmentPermissionAttribute (SecurityAction.Deny, Unrestricted = true) */ public static void DenyAllMethod() { Console.WriteLine("Executing DenyAllMethod."); Console.WriteLine("Denied all EnvironmentPermissions"); DenyAllTestMethod(); } //DenyAllMethod // This method tests to assure permissions have been denied. public static void DenyAllTestMethod() { Console.WriteLine("Executing DenyAllTestMethod."); try { PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission(new EnvironmentPermission( EnvironmentPermissionAccess.Read, "COMPUTERNAME")); Console.WriteLine("Demanding permission to read 'COMPUTERNAME'."); // This demand should cause an exception. ps.Demand(); // The TestFailed method is called if the expected // exception is not thrown. TestFailed(); } catch (System.Exception e) { Console.WriteLine(("An exception was thrown because " + "of a read demand: " + e.get_Message())); } } //DenyAllTestMethod public static void TestFailed() throws Exception { Console.WriteLine("Executing TestFailed method."); Console.WriteLine("Throwing an exception."); throw new Exception(); } //TestFailed public static void main(String[] args) { PermissionDemo(); } //main } //MyClass

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EnvironmentPermissionAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | Action | セキュリティ アクションを取得または設定します。 ( SecurityAttribute から継承されます。) |
![]() | All | 文字列値が指定する環境変数へのフル アクセスを設定します。 |
![]() | Read | 文字列値が指定する環境変数への読み取りアクセスを取得または設定します。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
![]() | Unrestricted | 属性によって保護されているリソースに対して完全な (無制限の) アクセス許可が宣言されているかどうかを示す値を取得または設定します。 ( SecurityAttribute から継承されます。) |
![]() | Write | 文字列値が指定する環境変数への書き込みアクセスを取得または設定します。 |

EnvironmentPermissionAttribute メソッド

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

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

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

名前 | 説明 | |
---|---|---|
![]() | Action | セキュリティ アクションを取得または設定します。(SecurityAttribute から継承されます。) |
![]() | All | 文字列値が指定する環境変数へのフル アクセスを設定します。 |
![]() | Read | 文字列値が指定する環境変数への読み取りアクセスを取得または設定します。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
![]() | Unrestricted | 属性によって保護されているリソースに対して完全な (無制限の) アクセス許可が宣言されているかどうかを示す値を取得または設定します。(SecurityAttribute から継承されます。) |
![]() | Write | 文字列値が指定する環境変数への書き込みアクセスを取得または設定します。 |

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

- EnvironmentPermissionAttributeのページへのリンク