How can I query IIS for MIME Type Mappings?
问题 How can I programatically read IIS's MIME types? I'd like to use them when I stream data to my clients using WCF. Any tips, or API would be appreciated 回答1: I'm making the assumption this is IIS7 only and you're using C#3.0 or later: using Microsoft.Web.Administration; .... using(ServerManager serverManager = new ServerManager()) { // If interested in global mimeMap: var config = serverManager.GetApplicationHostConfiguration(); // Use if interested in just a particular site's mimeMap: // var