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

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

HostProtectionAttribute.SecurityInfrastructure プロパティ

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

セキュリティ インフラストラクチャ公開されているかどうかを示す値を取得または設定します

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

<ComVisibleAttribute(True)> _
Public Property SecurityInfrastructure As
 Boolean
Dim instance As HostProtectionAttribute
Dim value As Boolean

value = instance.SecurityInfrastructure

instance.SecurityInfrastructure = value
[ComVisibleAttribute(true)] 
public bool SecurityInfrastructure { get;
 set; }
[ComVisibleAttribute(true)] 
public:
property bool SecurityInfrastructure {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_SecurityInfrastructure ()

/** @property */
public void set_SecurityInfrastructure (boolean
 value)
public function get SecurityInfrastructure
 () : boolean

public function set SecurityInfrastructure
 (value : boolean)

プロパティ
セキュリティ インフラストラクチャ公開されている場合trueそれ以外場合false既定値false です。

解説解説
使用例使用例

SecurityInfrastructure プロパティを持つ HostProtectionAttribute 属性使用するコード例次に示します。このコード例は、HostProtectionAttribute クラストピック取り上げているコード例一部分です。

' Use the enumeration flags to indicate that this method exposes shared
  
' state, self-affecting threading, and the security infrastructure.
<HostProtectionAttribute(SharedState := True, _
    SelfAffectingThreading := True, _
    SecurityInfrastructure := True)> _
Private Shared Function
 ApplyIdentity() As Integer

    ' ApplyIdentity sets the current identity.
    Dim roles(1) As String
    Try
        Dim mAD As AppDomain = AppDomain.CurrentDomain
        Dim mGenPr As _
            New GenericPrincipal(WindowsIdentity.GetCurrent(),
 roles)
        mAD.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
        mAD.SetThreadPrincipal(mGenPr)
        Return Success
    Catch e As Exception
        [Exit](e.ToString(), 5)
    End Try
    Return 0
End Function 'ApplyIdentity
// Use the enumeration flags to indicate that this method exposes shared
 
// state, self-affecting threading, and the security infrastructure.
[HostProtectionAttribute(SharedState=true, SelfAffectingThreading=true
,
     SecurityInfrastructure=true)]
// ApplyIdentity sets the current identity.
private static int ApplyIdentity()
{
    string[] roles = {"User"};
    try
    {
        AppDomain mAD = AppDomain.CurrentDomain;
        GenericPrincipal mGenPr = 
            new GenericPrincipal(WindowsIdentity.GetCurrent(),
 roles);
        mAD.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
        mAD.SetThreadPrincipal(mGenPr);
        return Success;
    }
    catch (Exception e)
    {
        Exit(e.ToString(), 5);
    }
    return 0;
}
   // Use the enumeration flags to indicate that this method exposes shared
 state, 
   // self-affecting threading and the security infrastructure.
   // ApplyIdentity sets the current identity.

   [HostProtection(SharedState=true,SelfAffectingThreading=true
,
   SecurityInfrastructure=true)]
   static int ApplyIdentity()
   {
      array<String^>^roles = {"User"};
      try
      {
         AppDomain^ mAD = AppDomain::CurrentDomain;
         GenericPrincipal^ mGenPr = gcnew GenericPrincipal( WindowsIdentity::GetCurrent(),roles
 );
         mAD->SetPrincipalPolicy( PrincipalPolicy::WindowsPrincipal );
         mAD->SetThreadPrincipal( mGenPr );
         return Success;
      }
      catch ( Exception^ e ) 
      {
         Exit( e->ToString(), 5 );
      }

      return 0;
   }


public:

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


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS