Line number in file : <p>I'm having some problem with getting line number.</p>

<p>Here is what I got : </p>

<pre><code>        var lines = File.ReadLines(fileNameData, Encoding.Default);

        foreach (string line in lines)
        {
            if (line.Contains("()"))
            {
                MessageBox.Show(line );
            }
        }
</code></pre>

<p>Which show me </p>

<pre><code>       MessageBox.Show(line );
</code></pre>

<p>So it's shows me lanes which contains (), and it works correctly.
Is there any possibitity to get this line number.</p>

<pre><code>       MessageBox.Show(line + lineIndex);
</code></pre>

<p>Does anyone know how to accomplish that?</p>
