0

I developed an HttpHandler in order to count number of downloads for PDF files.

Now the problem is: How can I make IIS use my handler for PDF files?

4

1 回答 1

2

For IIS 7 it does depend on which mode you are running IIS in. Microsoft has a great tutorial on this How to: Register HTTP Handlers which goes over all the different configuration scenarios but assuming you are running IIS 7 in integrated mode and your handler is a compiled binary you would need a web.config entry similar to the following:

<configuration>
  <system.webServer>
    <handlers>
      <add name="pdfCountHandler" verb="*" 
        path="*.pdf" 
        type="<your handler class name>, <your handler assembly name>" 
        resourceType="Unspecified" />
    </handlers>
  </system.webServer>
</configuration>
于 2013-02-13T08:01:13.720 回答