You can't just get a specific line. To get line N you must then you have to read every line before that and, if you don't need them, just discard them.vb.net Code:
Private Function GetLineFromFile(filePath As String, lineNumber As Integer) As String Using reader As New IO.StreamReader(filePath) Dim line As String = Nothing For i = 1 To lineNumber line = reader.ReadLine() If line = Nothing Then 'No more lines Exit For End If Next Return line End Using End Function




Reply With Quote