CompilationSection.Strict 属性
定义
获取或设置 Visual Basic strict 编译选项。Gets or sets the Visual Basic strict compile option.
public:
property bool Strict { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("strict", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
public bool Strict { get; set; }
[<System.Configuration.ConfigurationProperty("strict", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
member this.Strict : bool with get, set
Public Property Strict As Boolean
属性值
如果使用 Visual Basic true 编译选项,则为 strict;否则为 false。true if the Visual Basic strict compile option is used; otherwise, false. 默认值为 true。The default is true.
- 属性
示例
下面的代码示例演示如何使用 Strict 属性。The following code example demonstrates how to use the Strict property. 此代码示例是为类提供的更大示例的一部分 CompilationSection 。This code example is part of a larger example provided for the CompilationSection class.
// 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 ,编译显式禁止发生数据丢失的任何数据类型转换,以及数值类型和字符串之间的任何转换。When true, compilation explicitly disallows any data-type conversions in which data loss would occur, and any conversion between numeric types and strings.