I need to get the encoding type of a csv file and how can i do this in c#.net..

My code to avoid Byte Order Mapping(BMO) added during UTF8 encoding is as follows:

```
     public static void SaveAsUTF8WithoutByteOrderMark(string fileName, Encoding encoding)
     {
        if (fileName == null)
             throw new ArgumentNullException("fileName");

    if (encoding == null)
    {
        encoding = Encoding.Default;
    }

    File.WriteAllText(fileName, File.ReadAllText(fileName, encoding), new UTF8Encoding(false));
      }

```

But any one please tell me how i can find the encoding of a csv file in C#.net..