2012年10月29日

摘要: 若要添加 MIME 类型,请使用以下语法:appcmd set config /section:staticContent /+"[fileExtension='string',mimeType='string']"变量fileExtensionstring表示文件扩展名。 变量mimeTypestring表示 MIME 类型。例如,若要创建 MIME 类型,请在命令提示符处键入以下命令,然后按 Enter:appcmd set config /section:staticContent /+"[fileExtension=' 阅读全文
posted @ 2012-10-29 16:06 航甫 阅读(929) 评论(0) 推荐(0) 编辑
摘要: public static void AddMIMEType(){ DirectoryEntry rootEntry = GetDirectoryEntry("IIS://localhost/w3svc/1/root"); foreach(PropertyValueCollection pc in rootEntry.Properties) { Console.WriteLine(pc.PropertyName+":"+pc.Value); } //rootEntry.Properties["MimeMap"].Add( IISOle 阅读全文
posted @ 2012-10-29 16:00 航甫 阅读(458) 评论(0) 推荐(0) 编辑

导航