English 中文(简体)
如何将IIS://localhost/MimeMap绑定到默认网站以外的其他网站
原标题:How to bind IIS://localhost/MimeMap to something other than the default website

我需要获取代码运行的“当前”网站的MIME类型,而不是通常分配给IIS的全局MIME类型列表。我有一些MIME类型在本地分配给一个特定的网站,我只想在这个网站上使用,而不是在所有网站的服务器范围内使用。

DirectoryEntry Path=新的DirectoryEntry(“IIS://localhost/MimeMap”);

使用上面的内容,我只得到了那些全局IIS MIME类型。我尝试过:

DirectoryEntry Path=新的DirectoryEntry(“IIS://”+HttpContext.Current.Request.Url.Host+“/MimeMap”);

但没有成功。我得到了相同的全局MIME类型列表,而不是我分配给运行代码的站点的本地MIME类型。

我最初使用的方法要求我从WINDOWSSystem32inetsrv目录中引用Microsoft.Web.Administration,但如果没有必要,我宁愿不引用它。

谢谢

问题回答

暂无回答




相关问题
session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

How to use appcmd to set debug=false in IIS7

I m trying to use APPCMD to set debug=false in web.config, per the documentation. The specific syntax I am using is: APPCMD SET CONFIG "SITE/VDIR" section:compilation /debug:False /commit:APP ...

Windows User Account that executes only IIS7 Provisions

I have a web application that executes IIS 7 provisions (using Microsoft.Web.Administration.dll) to create our web and ftp sites. When I run this using the administrator account, it works ok. I want ...

Could I get by HttpModule the URL that contains * before?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support *...

IIS 7 Http Handler development issue

I am using VSTS 2008 + C# + .Net 3.5 + IIS 7.0 to develop an ASP.Net web site. I want to develop an Http module, which could inspect whether incoming request has some specific http header (e.g. ...

热门标签