ConfigurationErrorsException.Line 属性

定义

获取配置文件中引发此配置异常处的行号。

public:
 virtual property int Line { int get(); };
public override int Line { get; }
member this.Line : int
Public Overrides ReadOnly Property Line As Integer

属性值

配置文件中引发此 ConfigurationErrorsException 异常处的行号。

示例

下面的代码示例演示如何获取 Line 属性值。

int lineNumber = err.Line;
Console.WriteLine("Line: {0}", lineNumber.ToString());
Dim lineNumber As Integer = err.Line
Console.WriteLine("Line: {0}", _
lineNumber.ToString())

适用于