I wrote code that counts lines in text file and creates folders with lines. For example If there is text like this
Text1
Text2
Text3
The folders would be made with those texts. Here's the code that throws System.IndexOutOfRangeException
Error
Dim lineCount = File.ReadAllLines(TempPath & "EAB\EAB.txt").Length
For i = 0 To lineCount Step 1
Dim RAL As String = File.ReadAllLines(TempPath & "EAB\EAB.txt")(i)
Directory.CreateDirectory(startPath & "\Test\" & RAL & "\")
Next
It creates folders perfectly but whenever it finishes creating folder it throws System.IndexOutOfRangeException
Error In File.ReadAllLines
. Can anybody help me to fix this?