.NET HttpHandlers的传递要求最高的管道IIS6 [英] .net HttpHandlers Pass Request Up The Pipeline To IIS6

查看:141
本文介绍了.NET HttpHandlers的传递要求最高的管道IIS6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法为一个HTTP处理程序通过请求备份管道IIS 6,让它处理请求?

Is there a way for a Http Handler to pass a request back up the pipeline to IIS 6 and let it handle the request?

例如,如果我有一个HTTP处理程序集动词=(通配符)路径=(通配符).TXT

For example, if I have a Http Handler set for verb="(wildcard)" path="(wildcard).txt"

我有一个名为myunformated.txt文件,我想IIS 6将其发送给用户,如果它没有附带查询字符串PARAMS。

I have a file called myunformated.txt, I would like IIS 6 to send it to the user if it doesn't have querystring params attached.

任何想法?

推荐答案

在回答你的问题是没有。这是IIS7 acheives的综合管线,但其在IIS6不可用的东西。

The answer to your question is no. That's what the integrated pipeline of IIS7 acheives but its not available on IIS6.

在这种特殊情况下使用context.Response.TransmitFile会做的伎俩,虽然,你应该考虑设置响应的内容类型,字符集和缓存控制头,是这样的: -

In this specific case using context.Response.TransmitFile will do the trick although you should consider setting the Response content type, charset and cache control headers, something like:-

HttpResponse Response = context.Response

Response.ContentType = "text/plain";
Response.CharSet = "Windows-1252";
Response.AddFileDependency(filePath);

// Set additional properties to enable caching.
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetValidUntilExpires(true);
Response.TransmitFile(filePath);

这pretty的多重复什么IIS静态内容处理程序将做。

This pretty much duplicates what IIS static content handler would be doing.

这篇关于.NET HttpHandlers的传递要求最高的管道IIS6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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