c# parallel foreach loop finding index : <p>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?</p>

<pre><code>string[] lines = File.ReadAllLines("MyFile.txt");
    List&lt;string&gt; list_lines = new List&lt;string&gt;(lines);
    Parallel.ForEach(list_lines, (line, index) =&gt;
      {
         Console.WriteLine(index);
    //   Console.WriteLine(list_lines[index]);
         Console.WriteLine(list_lines[0]);
       });
       Console.ReadLine();
</code></pre>
