SecurityManager.SecurityEnabled プロパティ

定義

注意事項

Because security can no longer be turned off permanently, setting the SecurityEnabled property no longer has any effect. Reading the property will still indicate whether security has been turned off temporarily.

注意事項

Because security can no longer be turned off, the SecurityEnabled property no longer has any effect.

セキュリティが有効かどうかを示す値を取得または設定します。

public:
 static property bool SecurityEnabled { bool get(); void set(bool value); };
public static bool SecurityEnabled { get; set; }
[System.Obsolete("Because security can no longer be turned off permanently, setting the SecurityEnabled property no longer has any effect. Reading the property will still indicate whether security has been turned off temporarily.")]
public static bool SecurityEnabled { get; set; }
[System.Obsolete("Because security can no longer be turned off, the SecurityEnabled property no longer has any effect.")]
public static bool SecurityEnabled { get; set; }
static member SecurityEnabled : bool with get, set
[<System.Obsolete("Because security can no longer be turned off permanently, setting the SecurityEnabled property no longer has any effect. Reading the property will still indicate whether security has been turned off temporarily.")>]
static member SecurityEnabled : bool with get, set
[<System.Obsolete("Because security can no longer be turned off, the SecurityEnabled property no longer has any effect.")>]
static member SecurityEnabled : bool with get, set
Public Shared Property SecurityEnabled As Boolean

プロパティ値

true セキュリティが有効な場合。それ以外の場合は false

属性

例外

このメソッドを呼び出すコードには ControlPolicyがありません。

注釈

このプロパティは、Caspol.exe (コード アクセス セキュリティ ポリシー ツール) によって使用されます

-security (-s) オプションを使用して、コード ベースのセキュリティをオフにします。

SecurityEnabled は、管理者がコード アクセス セキュリティを無効にする方法を提供します。 コード アクセス セキュリティが無効になっている場合、すべてのコード アクセス要求は成功します。 実質的に、これによりすべてのコード FullTrustが付与されます。 コード アクセス セキュリティを無効にするとセキュリティ システムがバイパスされるため、すべてのコードに FullTrust を付与する同等のセキュリティ ポリシーよりもコードのパフォーマンスが若干向上する可能性があります。 このプロパティは、ロールベースのセキュリティを無効にしません。したがって、 PrincipalPermission の要求は影響を受けません。

Caution

コード アクセス セキュリティを無効にすると、システムは、ウイルスやワームなどの悪意のあるコードの攻撃を受けやすくなります。 コード アクセス セキュリティを無効にしても、マネージド コードの実行が自動的にブロックされることはありません。 マネージド コードは、コード アクセス セキュリティ システムによる制限なしに実行されるだけであり、最も細心の注意を払って実行する必要があります。 セキュリティをオフにしてパフォーマンスを向上させるには、システムのセキュリティを保護するために他のセキュリティ対策が講じられている場合にのみ行う必要があります。 その他のセキュリティ対策の例としては、公衆ネットワークからの切断、コンピューターの物理的な保護などがあります。

このプロパティの変更は、 SavePolicy が呼び出されるまでレジストリに保持されません。 新しいプロセスは、レジストリに保持されるまで変更の影響を受けなくなります。 実行中のプロセスでこのプロパティの値を変更しても、予期した方法で状態が変更されるとは限りません。 変更を確実に有効にするには、 SavePolicy を呼び出して新しいプロセスを開始する必要があります。

適用対象