题
我使用URLMON查找文件然而它并没有顺利的时候我无法得到的CSS文件和多个主权财富基金的正确的MIME的MIME。我可以用获得文件的MIME?
解决方案
嗯,我不知道我完全理解你的问题,但如果你想要做某种查找对主列表,你可以看看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
}
}
不隶属于 StackOverflow