Share via


XmlValidatingReader.LinePosition 屬性

定義

取得目前的行位置。

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

屬性值

Int32

目前的行位置。 這個屬性的起始值為 1。

實作

備註

注意

類別 XmlValidatingReader 在 .NET Framework 2.0 中已過時。 您可以使用 類別和 Create 方法建立驗證 XmlReader 實例 XmlReaderSettings 。 如需詳細資訊,請參閱 XmlReader 參考頁面的<備註>一節。

此屬性最常用於錯誤報表,但可以隨時呼叫。 這個屬性 1 的起始值為 。

指出的位置是標記中文字的第一個字元。

<root>  
 abc<tag/>  
</root>  

在上述 XML 文字的第一行上, LinePosition2 會對應至 字元 r ;在第二行中, LinePosition 3 LinePosition5 對應至 字元 t ;在第三行,的 對應至 字元 r

與 結合 LineNumber ,值 1,1 表示檔的開頭。

適用於

另請參閱