HostProtectionAttribute.Resources プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HostProtectionAttribute.Resources プロパティの意味・解説 

HostProtectionAttribute.Resources プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ホストに害を及ぼす可能性がある機能カテゴリ指定するフラグ取得または設定します

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

Public Property Resources As
 HostProtectionResource
Dim instance As HostProtectionAttribute
Dim value As HostProtectionResource

value = instance.Resources

instance.Resources = value
public HostProtectionResource Resources { get;
 set; }
public:
property HostProtectionResource Resources {
    HostProtectionResource get ();
    void set (HostProtectionResource value);
}
/** @property */
public HostProtectionResource get_Resources ()

/** @property */
public void set_Resources (HostProtectionResource
 value)
public function get Resources
 () : HostProtectionResource

public function set Resources
 (value : HostProtectionResource)

プロパティ
HostProtectionResource 値のビットごとの組み合わせ既定値は None です。

解説解説

HostProtectionResource フラグは、ホストに害を及ぼす可能性があるメソッドまたはクラスによって公開されるリソース指定します

使用例使用例

Resources プロパティを持つ 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 );
}


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


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

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

辞書ショートカット

すべての辞書の索引

「HostProtectionAttribute.Resources プロパティ」の関連用語

HostProtectionAttribute.Resources プロパティのお隣キーワード
検索ランキング

   

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



HostProtectionAttribute.Resources プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS