一套处理程序,在IIS PDF [英] Set handler for PDF in IIS

查看:129
本文介绍了一套处理程序,在IIS PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个的HttpHandler 为了计算下载数量为PDF文件。

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

现在的问题是:如何让IIS使用我的处理程序为PDF文件

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

推荐答案

有关IIS 7它不依赖于该模式下,你正在运行在IIS微软有一个很好的教程的如何:注册HTTP处理程序肚里了各种不同的配置方案,但假设你是在集成模式下运行IIS 7,你的处理程序是编译好的二进制,你将需要类似于下面的一个web.config条目:

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>

这篇关于一套处理程序,在IIS PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆