http://www.microsoft.com/china/technet/security/guidance/secmod98.mspx 说:
<httpHandlers> 
将不用的文件类型映射到 HttpForbiddenHandler,以防止通过 HTTP 检索文件。例如: <add verb="*" path="*.rem"             
type="System.Web.HttpForbiddenHandler"/>  我的配置文件:<configuration>
<appSettings>
<add key="DbFilePath" value="Database/db1.mdb"/>
<add key="BackupDatabases" value="Database/BackupDatabases"/>
</appSettings>
 <system.web>
<compilation debug="true"/>
<sessionState cookieless="true"/>
<trace enabled="true" requestLimit="40" localOnly="false"/>
<httpHandlers>
<add verb="*" path="*.mdb" type="System.Web.HttpForbiddenHandler"/>
</httpHandlers>
</system.web>
</configuration>
为什么我对access文件还是能够下载呢。郁闷。

解决方案 »

  1.   

    试试在IIS里的应用程序的配置里,把.mdb后缀影射到aspnet_isapi.dll
      

  2.   

    可以了。但是,为什么还要修改iis那?不能够在配置文件中就完成么?
      

  3.   

    When you request a resource such as an HTML page or ASP page using the browser, IIS processes that resource based on its file extension. E.g. IIS processes 'asp' pages using a DLL named asp.dll. Similarly, IIS processes ASP.NET (.aspx) pages with the aspnet_isapi.dll. But sometimes you want ASP.NET to process a custom extension file(.mdb). You must also associate that file type with the aspnet_isapi.dll in the App Mappings property.