I am trying to read all lines in a text file and planning to display each line info. How can I find the index for each item inside loop?
string[] lines = Fil
There is another overload for Parallel.ForEach that gives you the index.
Parallel.ForEach
Parallel.ForEach(list_lines, (line, state, index) => { Console.WriteLine(index); Console.WriteLine(list_lines[index]); });