ASP.net处理于一体的ashx文件自定义文件扩展名的请求 [英] ASP.net handling all requests for a custom file extension in one ashx file

查看:127
本文介绍了ASP.net处理于一体的ashx文件自定义文件扩展名的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何配置我的Asp.net项目来处理自定义的文件扩展名,如.coolpix的所有请求,无论请求路径在一个ashx的文件。

How can I configure my Asp.net project to handle all requests for a custom file extension like ".coolpix" regardless of the request path in one ashx file.

推荐答案

如果你想要一个应用程序的野生解决方案,一种方法,你archieve它是通过添加一个处理程序映射到你的的web.config

If you want an application wild solution, a way to you archieve it, is by adding a handler mapping into your web.config:

  <system.webServer>
    <handlers>
      <add name="myExtensionHandler" preCondition="integratedMode" verb="GET" path="*.Extension" type="NameSpace.MyExtentionHandlerClass, DLLAssemblyName" />
    </handlers>
  </system.webServer>

MyExtentionHandlerClass 应实施 IHttpAsyncHandler 的IHttpHandler

这篇关于ASP.net处理于一体的ashx文件自定义文件扩展名的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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