Hello everyone. I want streamreader.Readblock to start reading a file from a specific line, but I need some help with this. So far I have have the following example code:
but I recieve the error: "Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection."Code:Dim lineposition As Integer = 20 Dim buffer As Char() = "" Dim count As Integer = 256 Dim dataReader As New StreamReader("C:\lines.txt") For i = lineposition To 100 dataReader.ReadBlock(buffer, i, count) 'show data MsgBox("Success " & buffer.ToString) Next i dataReader.Close()




Reply With Quote
