HostProtectionResource 列挙体とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HostProtectionResource 列挙体の意味・解説 

HostProtectionResource 列挙体

メモ : この列挙体は、.NET Framework version 2.0新しく追加されたものです。

メソッドまたはクラスによって呼び出され場合ホストに害を及ぼす可能性がある機能カテゴリ指定します

この列挙体には、メンバ値のビットごとの組み合わせ可能にする FlagsAttribute 属性含まれています。

名前空間: System.Security.Permissions
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<SerializableAttribute> _
<FlagsAttribute> _
<ComVisibleAttribute(True)> _
Public Enumeration HostProtectionResource
Dim instance As HostProtectionResource
[SerializableAttribute] 
[FlagsAttribute] 
[ComVisibleAttribute(true)] 
public enum HostProtectionResource
[SerializableAttribute] 
[FlagsAttribute] 
[ComVisibleAttribute(true)] 
public enum class HostProtectionResource
/** @attribute SerializableAttribute() */ 
/** @attribute FlagsAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public enum HostProtectionResource
SerializableAttribute 
FlagsAttribute 
ComVisibleAttribute(true) 
public enum HostProtectionResource
メンバメンバ
解説解説

この列挙体は HostProtectionAttribute 属性使用されます。

使用例使用例

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 );
}


プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Security.Permissions 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からHostProtectionResource 列挙体を検索した結果を表示しています。
Weblioに収録されているすべての辞書からHostProtectionResource 列挙体を検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHostProtectionResource 列挙体 を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「HostProtectionResource 列挙体」の関連用語

HostProtectionResource 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HostProtectionResource 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS