Q:

Opposite of MimeMapping.GetMimeMapping?

There exists MimeMapping.GetMimeMapping(string filename)
Does there exist a .Net function, that does the 'opposite'.  That takes a mime string and returns the file type extension ?

A:

You can read the registry to get that information.
var mapping = Microsoft.Win32.Registry.ClassesRoot.GetSubKeyNames()
               .Select(key => new
                {
                    Key = key,
                    ContentType = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(key).GetValue("Content Type")
                })
                .Where(x => x.ContentType != null)
                .ToLookup(x => x.ContentType, x => x.Key);

Console.WriteLine(String.Join(";",mapping["image/jpeg"]));

