【问题标题】:Set handler for PDF in IIS在 IIS 中为 PDF 设置处理程序
【发布时间】:2013-01-28 16:51:36
【问题描述】:

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

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

【问题讨论】:

    标签: asp.net iis iis-7 httphandler


    【解决方案1】:

    对于 IIS 7,它确实取决于您在哪种模式下运行 IIS。Microsoft 对此How to: Register HTTP Handlers 有一个很棒的教程,其中涵盖了所有不同的配置方案,但假设您在集成模式下运行 IIS 7 并且您的处理程序是一个已编译的二进制文件,您需要一个类似于以下内容的 web.config 条目:

    <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>
    

    【讨论】:

      猜你喜欢
      • 2011-05-14
      • 1970-01-01
      • 1970-01-01
      • 2014-05-24
      • 1970-01-01
      • 2011-06-11
      • 1970-01-01
      • 1970-01-01
      • 2011-08-23
      相关资源
      最近更新 更多