AspNetHostingPermissionLevel Перечисление

Определение

Specifies the trust level that is granted to an ASP.NET Web application.Specifies the trust level that is granted to an ASP.NET Web application.

public enum class AspNetHostingPermissionLevel
public enum AspNetHostingPermissionLevel
[System.Serializable]
public enum AspNetHostingPermissionLevel
type AspNetHostingPermissionLevel = 
Public Enum AspNetHostingPermissionLevel
Наследование
AspNetHostingPermissionLevel
Атрибуты

Поля

High 500

Indicates that features protected with a demand for any level less than or equal to the High trust level will succeed.Indicates that features protected with a demand for any level less than or equal to the High trust level will succeed. This level is intended for highly trusted managed-code applications that need to use most of the managed permissions that support semi-trusted access.This level is intended for highly trusted managed-code applications that need to use most of the managed permissions that support semi-trusted access. It does not grant some of the highest permissions (for example, the ability to call into native code), but it does provide a way to run trusted applications with least privilege or to provide some level of constraints for highly trusted applications.It does not grant some of the highest permissions (for example, the ability to call into native code), but it does provide a way to run trusted applications with least privilege or to provide some level of constraints for highly trusted applications. This level is granted by configuring at least the High trust level in the trust section in a configuration file.This level is granted by configuring at least the High trust level in the trust section in a configuration file.

Low 300

Indicates that features protected with a demand for any level less than or equal to the Low level will succeed.Indicates that features protected with a demand for any level less than or equal to the Low level will succeed. This level is intended to allow read-only access to limited resources in a constrained environment.This level is intended to allow read-only access to limited resources in a constrained environment. This level is granted by specifying the Low trust level in the trust section in a configuration file.This level is granted by specifying the Low trust level in the trust section in a configuration file.

Medium 400

Indicates that features protected with a demand for any level less than or equal to the Medium level will succeed.Indicates that features protected with a demand for any level less than or equal to the Medium level will succeed. This level is granted by configuring at least the Medium trust level in the trust section in a configuration file.This level is granted by configuring at least the Medium trust level in the trust section in a configuration file.

Minimal 200

Indicates that features protected with a demand for the Minimal level will succeed.Indicates that features protected with a demand for the Minimal level will succeed. This level allows code to execute but not to interact with resources present on the system.This level allows code to execute but not to interact with resources present on the system. This level is granted by configuring at least the Minimal trust level using the trust section in a configuration file.This level is granted by configuring at least the Minimal trust level using the trust section in a configuration file.

None 100

Indicates that no permission is granted.Indicates that no permission is granted. All demands for AspNetHostingPermission will fail.All demands for AspNetHostingPermission will fail.

Unrestricted 600

Indicates that all demands for permission to use all features of an application will be granted.Indicates that all demands for permission to use all features of an application will be granted. This is equivalent to granting Full trust level in the trust section in a configuration file.This is equivalent to granting Full trust level in the trust section in a configuration file.

Комментарии

Подробные сведения о разрешениях, предоставляемых каждому уровню доверия, см. в разделе ASP.NET Code Access Security .See ASP.NET Code Access Security for detailed information about the permissions that are granted to each trust level.

Члены этого перечисления определяют уровни безопасности приложения от полного доверия (приложение не ограничивается системой управления доступом для кода) до минимального уровня доверия (приложение имеет разрешение только на выполнение).The members of this enumeration define application security levels ranging from full trust (the application is unconstrained by code access security) to minimal trust (the application has permission only to execute). Уровень доверия для ресурса ASP.NET задается с помощью элемента конфигурации доверия в файле Web. config или Machine. config.You set the trust level for an ASP.NET resource with the trust configuration element in a Web.config or Machine.config file.

Если вы хотите заблокировать политику безопасности для определенного сервера или веб-сайта, используйте элемент Location в сочетании с атрибутом allowOverride=false, чтобы гарантировать, что параметры политики доверия не могут быть переопределены локально.If you want to lock security policy for a specific server or Web site, use the location element in conjunction with the allowOverride=false attribute to ensure that trust policy settings cannot be overridden locally.

Применяется к

Дополнительно