TextFieldParser.LineNumber 属性    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回当前行号,如果流中没有更多字符,则返回 -1。
public:
 property long LineNumber { long get(); };
	public long LineNumber { get; }
	member this.LineNumber : int64
	Public ReadOnly Property LineNumber As Long
	属性值
当前行号。
示例
本示例在文本文件中搜索名称“Jones”,并报告 (发生) 的行。
Using FileReader As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\ParserText.txt")
    FileReader.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited
    FileReader.Delimiters = New String() {","}
    Dim currentRow As String()
    While Not FileReader.EndOfData
        Try
            currentRow = FileReader.ReadFields()
            Dim currentField As String
            For Each currentField In currentRow
                If currentField = "Jones" Then
                    MsgBox("The name Jones occurs on line " & 
                    FileReader.LineNumber)
                End If
            Next
        Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
            MsgBox("Line " & ex.Message & 
           "is not valid and will be skipped.")
        End Try
    End While
End Using
	注解
这是一个高级成员;除非单击“ 全部 ”选项卡,否则它不会显示在 IntelliSense 中。
确定行号时,不会忽略空行和注释。