0

我正在使用 urlmon 来查找文件的 MIME,但是当我无法获得正确的 css 文件和更多 SWF 的 mime 时,它​​并不顺利。我可以用什么来获取文件 mime?

4

1 回答 1

1

嗯,我不确定我是否完全理解您的问题,但是如果您想对主列表进行某种查找,您可以查看 IIS 元数据库

using (DirectoryEntry directory = new DirectoryEntry("IIS://Localhost/MimeMap")) {
    PropertyValueCollection mimeMap = directory.Properties["MimeMap"];
    foreach (object Value in mimeMap) {
        IISOle.MimeMap mimetype = (IISOle.MimeMap)Value;
        //use mimetype.Extension and mimetype.MimeType to determine 
        //if it matches the type you are looking for
    }
 }
于 2009-07-01T02:10:16.450 回答