CSV parsers and OrderedDictionary I wrote the following (static) class to read files easily in C#. However, it is a static class, so I wonder if there would be a gain to make it a non static method (and therefore, passing arguments as the separator and the path as attributes of the class).

Besides, the OrderedDictionary class may not be a good choice (it is not generic but it preserves the order of the columns), and I don't know if there is a nice workaround for this.

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;

namespace MySolution.FileUtils
{
    /// &lt;summary&gt;
    /// Various helpers to read through the lines of a file.
    /// &lt;/summary&gt;
    public static class LinesEnumerator
    {
        public static string ReadFirstLine(string path)
        {
            using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            using (StreamReader sr = new StreamReader(fs))
            {
                return sr.ReadLine();
            }
        }

        /// &lt;summary&gt;
        /// Enumerates the lines of a file.
        /// &lt;/summary&gt;
        /// &lt;param name="path"&gt;The path of the file.&lt;/param&gt;
        /// &lt;param name="maxLines"&gt;The maximum number of lines to read.&lt;/param&gt;
        /// &lt;returns&gt;The lines of a file, as a IEnumerable&lt;/returns&gt;
        public static IEnumerable&lt;string&gt; LinesReader(string path, int maxLines = Int32.MaxValue)
        {
            string line;
            int lineNumber = 0;
            using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            using (StreamReader sr = new StreamReader(fs))
            {
                while ((line = sr.ReadLine()) != null &amp;&amp; lineNumber &lt; maxLines)
                {
                    lineNumber++;
                    yield return line;
                }
            }
        }

        /// &lt;summary&gt;
        /// Reads the lines of a CSV file and enumerates them through a csv file
        /// &lt;/summary&gt;
        /// &lt;param name="path"&gt;Path to the CSV file&lt;/param&gt;
        /// &lt;param name="separator"&gt;Separator used by the CSV file&lt;/param&gt;
        /// &lt;returns&gt;A collection of ordered dictionaries, corresponding to the lines of the file&lt;/returns&gt;
        public static IEnumerable&lt;OrderedDictionary&gt; DictReaderCSV(string path, char separator)
        {
            using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            using (StreamReader sr = new StreamReader(fs))
            {
                string[] header = sr.ReadLine().Split(separator);
                string line = "";
                while ((line = sr.ReadLine()) != null)
                {
                    string[] splittedLine = line.Split(separator);
                    OrderedDictionary od = new OrderedDictionary();
                    for (int i = 0; i &lt; header.Length; i++)
                        od.Add(header[i], splittedLine[i]);
                    yield return od;
                }
            }
        }
    }
}
Naming Items

You should avoid abbreviations like Dict in DictReaderCSV, spelling it Dictionary is cleaner.

Next, it's much more natural to use nouns for class names and verbs for methods. As such, I would name your class CSVDictionaryReader and your main method EnumerateEntries(). LinesEnumerator didn't give any hint that the class is also responsible for parsing CSV.

Unused code

ReadFirstLine and ReadFirstLine don't seem to be used in the current code.

Streams

The StreamReader class already provides constructors that receive a disk path, so no need to manually create a FileStream just to pass it onto the StreamReader.

What would however give much more flexibility is for the class to allow the user to provide it with an already constructed Stream or TextReader. Perhaps the user wants to parse a 100 MB CSV as it's arriving over the wire, without writing it to the disk.

Parsing CSV

CSV files allow for quotes to be used so that entries can contain the separator. A parser should be prepared to correctly deal with this.

Id,Name,Age
1,John,20
2,"Jack, the second", 21