CompilationSection.Strict 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置 Visual Basic strict 编译选项。
public:
property bool Strict { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("strict", DefaultValue=false)]
public bool Strict { get; set; }
[<System.Configuration.ConfigurationProperty("strict", DefaultValue=false)>]
member this.Strict : bool with get, set
Public Property Strict As Boolean
属性值
true 如果使用 Visual Basic strict 编译选项,则为 ;否则为 false。 默认值为 true。
- 属性
示例
下面的代码示例演示如何使用该 Strict 属性。 该代码示例是 CompilationSection 类中的一个较大示例的一部分。
// Display Strict property.
Console.WriteLine("Strict: {0}",
configSection.Strict);
// Set Strict property.
configSection.Strict = false;
' Display Strict property.
Console.WriteLine("Strict: {0}", _
configSection.Strict)
' Set Strict property.
configSection.Strict = False
注解
当 true编译显式禁止发生数据丢失的任何数据类型转换,以及数值类型和字符串之间的任何转换。