Udostępnij za pośrednictwem


SecurityManager.SecurityEnabled Właściwość

Definicja

Przestroga

Ten interfejs API jest już przestarzały.

Przestroga

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.

Przestroga

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

Przestroga

The security manager cannot be turned off on MS runtime

Pobiera lub ustawia wartość wskazującą, czy zabezpieczenia są włączone.

public:
 static property bool SecurityEnabled { bool get(); void set(bool value); };
[System.Obsolete]
public static bool SecurityEnabled { get; set; }
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; }
[System.Obsolete("The security manager cannot be turned off on MS runtime")]
public static bool SecurityEnabled { get; set; }
[<System.Obsolete>]
member this.SecurityEnabled : bool with get, set
member this.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.")>]
member this.SecurityEnabled : bool with get, set
[<System.Obsolete("Because security can no longer be turned off, the SecurityEnabled property no longer has any effect.")>]
member this.SecurityEnabled : bool with get, set
[<System.Obsolete("The security manager cannot be turned off on MS runtime")>]
member this.SecurityEnabled : bool with get, set
Public Shared Property SecurityEnabled As Boolean

Wartość właściwości

Boolean

true w przypadku włączenia zabezpieczeń; w przeciwnym razie , false.

Atrybuty

Wyjątki

Kod, który wywołuje tę metodę, nie ma ControlPolicyelementu .

Uwagi

Ta właściwość jest używana przez Caspol.exe (narzędzie zasad zabezpieczeń dostępu kodu)

-security (-s) opcja wyłączenia zabezpieczeń opartych na kodzie.

SecurityEnabled zapewnia administratorom możliwość wyłączenia zabezpieczeń dostępu do kodu. Gdy zabezpieczenia dostępu kodu są wyłączone, wszystkie żądania dostępu do kodu kończą się powodzeniem. W praktyce daje to cały kod FullTrust. Wyłączenie zabezpieczeń dostępu do kodu pomija system zabezpieczeń, dzięki czemu kod może działać nieco lepiej niż równoważne zasady zabezpieczeń udzielające FullTrust do całego kodu. Ta właściwość nie wyłącza zabezpieczeń opartych na rolach; w związku z PrincipalPermission tym zapotrzebowanie nie ma wpływu.

Przestroga

Wyłączenie zabezpieczeń dostępu kodu sprawia, że system staje się podatny na ataki złośliwego kodu, takiego jak wirusy i robaki. Wyłączenie zabezpieczeń dostępu do kodu nie powoduje automatycznego blokowania uruchamiania kodu zarządzanego w żaden sposób. Powoduje to uruchamianie kodu zarządzanego tylko bez ograniczeń przez system zabezpieczeń dostępu do kodu i powinno być wykonywane tylko z najbardziej ekstremalną ostrożnością. Wyłączenie zabezpieczeń w celu uzyskania dodatkowej wydajności należy wykonać tylko wtedy, gdy podjęto inne środki zabezpieczeń, aby chronić zabezpieczenia systemu. Przykłady innych środków ostrożności to: odłączenie od sieci publicznych, fizyczne zabezpieczanie komputerów i tak dalej.

Zmiana tej właściwości nie jest utrwalana w rejestrze, dopóki SavePolicy nie zostanie wywołana. Nowe procesy nie będą miały wpływu na zmianę, dopóki nie zostaną utrwalone w rejestrze. Zmiana wartości tej właściwości w uruchomionym procesie niekoniecznie zmienia stan w oczekiwany sposób. Aby zapewnić, że zmiany zaczęły obowiązywać, należy wywołać SavePolicy i rozpocząć nowy proces.

Dotyczy