TrustSection.Level 属性

定义

获取或设置应用程序将运行的安全级别的名称。

public:
 property System::String ^ Level { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("level", DefaultValue="Full", IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string Level { get; set; }
[<System.Configuration.ConfigurationProperty("level", DefaultValue="Full", IsRequired=true)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.Level : string with get, set
Public Property Level As String

属性值

信任级别的名称。 默认值为 "Full"

属性

示例

下面的代码示例演示如何使用该 Level 属性。 该代码示例是 TrustSection 类中的一个较大示例的一部分。

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

注解

Level 属性指定将运行应用程序的安全级别。 默认值为 "Full"

有五个可用的信任级别:

  • 完整

  • 中等

  • 最小

命名级别对应于元素<trustLevel><securityPolicy>中定义的安全级别。

适用于

另请参阅