TrustSection.Level Property

Definition

Gets or sets the name of the security level under which the application will run.

[System.Configuration.ConfigurationProperty("level", DefaultValue="Full", IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string Level { get; set; }

Property Value

The name of the trust level. The default is "Full".

Attributes

Examples

The following code example demonstrates how to use the Level property. This code example is part of a larger example provided for the TrustSection class.

// Display Level property
Console.WriteLine("Level: {0}", configSection.Level);

Remarks

The Level property specifies the security level under which the application will be run. The default is "Full".

There are five available trust levels:

  • Full

  • High

  • Medium

  • Low

  • Minimal

The named levels correspond to the security levels that are defined in the <trustLevel> element for <securityPolicy>.

Applies to

Produk Versi
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also