XmlException.LinePosition プロパティ

定義

エラーが発生した場所を示す行位置を取得します。 線の位置は 1 から始まります。

public:
 property int LinePosition { int get(); };
public int LinePosition { get; }
member this.LinePosition : int
Public ReadOnly Property LinePosition As Integer

プロパティ値

エラーが発生した場所を示す行の位置。

注釈

XML として文字列 "<<foo>\r\nbar</foo>" を読み込もうとすると、次のメッセージを含む XmlException がスローされます。

System.Xml.XmlException: 'Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 1, position 2.'

行位置が 1 から始まる (エラーが 2 番目の文字で見つかった) ことを示します。

適用対象