HostProtectionAttribute.SecurityInfrastructure プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As HostProtectionAttribute Dim value As Boolean value = instance.SecurityInfrastructure instance.SecurityInfrastructure = value
[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:

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に収録されているすべての辞書からHostProtectionAttribute.SecurityInfrastructure プロパティを検索する場合は、下記のリンクをクリックしてください。

- HostProtectionAttribute.SecurityInfrastructure プロパティのページへのリンク