HostProtectionResource 列挙体
この列挙体には、メンバ値のビットごとの組み合わせを可能にする FlagsAttribute 属性が含まれています。
名前空間: System.Security.Permissionsアセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <FlagsAttribute> _ <ComVisibleAttribute(True)> _ Public Enumeration HostProtectionResource
[SerializableAttribute] [FlagsAttribute] [ComVisibleAttribute(true)] public enum HostProtectionResource
[SerializableAttribute] [FlagsAttribute] [ComVisibleAttribute(true)] public enum class HostProtectionResource

メンバ名 | 説明 | |
---|---|---|
All | すべてのホスト リソースを公開します。 | |
ExternalProcessMgmt | 他のプロセスを作成または破棄することがあります。 | |
ExternalThreading | 他のスレッドを作成または操作します。この動作によって、ホストに害を及ぼすことがあります。 | |
MayLeakOnAbort | セーフ ハンドルによってまたはリソースを確実に解放するその他の方法によって保護されていない場合は、終了時にリソースのリークが発生することがあります。 | |
None | ホスト リソースを公開しません。 | |
SecurityInfrastructure | セキュリティ インフラストラクチャを公開します。 | |
SelfAffectingProcessMgmt | 現在のプロセスを終了し、サーバーを終了することがあります。 | |
SelfAffectingThreading | ユーザー コードだけに影響するようにスレッドを操作します。 | |
SharedState | スレッド間で共有される可能性がある状態を公開します。 | |
Synchronization | 同期を公開します。 | |
UI | ユーザー インターフェイスを公開します。 |


HostProtectionResource 列挙体と HostProtectionAttribute 属性を使用するコード例を次に示します。このコード例は、HostProtectionAttribute クラスのトピックで取り上げているコード例の一部分です。
' Use the enumeration flags to indicate that this method exposes ' shared state and self-affecting process management. ' Either of the following attribute statements can be used to set the ' resource flags. <HostProtectionAttribute(SharedState := True, _ SelfAffectingProcessMgmt := True), _ HostProtectionAttribute( _ Resources := HostProtectionResource.SharedState Or _ HostProtectionResource.SelfAffectingProcessMgmt)> _ Private Shared Sub [Exit](ByVal Message As String, ByVal Code As Integer) ' Exit the sample when an exception is thrown. Console.WriteLine((ControlChars.Lf & "FAILED: " & Message & " " & _ Code.ToString())) Environment.ExitCode = Code Environment.Exit(Code) End Sub 'Exit
// Use the enumeration flags to indicate that this method exposes // shared state and self-affecting process management. // Either of the following attribute statements can be used to set the // resource flags. [HostProtectionAttribute(SharedState = true, SelfAffectingProcessMgmt = true)] [HostProtectionAttribute(Resources = HostProtectionResource.SharedState | HostProtectionResource.SelfAffectingProcessMgmt)] private static void Exit(string Message, int Code) { // Exit the sample when an exception is thrown. Console.WriteLine("\nFAILED: " + Message + " " + Code.ToString()); Environment.ExitCode = Code; Environment.Exit(Code); }
// Use the enumeration flags to indicate that this method exposes shared state and // self-affecting process management. // Either of the following attribute statements can be used to set the // resource flags. // Exit the sample when an exception is thrown. [HostProtection(SharedState=true,SelfAffectingProcessMgmt=true)] [HostProtection(Resources=HostProtectionResource::SharedState| HostProtectionResource::SelfAffectingProcessMgmt)] static void Exit( String^ Message, int Code ) { Console::WriteLine( "\nFAILED: {0} {1}", Message, Code ); Environment::ExitCode = Code; Environment::Exit( Code ); }

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


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

- HostProtectionResource 列挙体のページへのリンク