简体   繁体   English

如何在IIS6上运行的.NET 4.0应用中读取响应标头?

[英]How do I read response headers in a .NET 4.0 app running on IIS6?

I am writing a custom IHttpModule implementor so I can log request/response information as required. 我正在编写一个自定义IHttpModule实现器,因此可以根据需要记录请求/响应信息。 However I've hit a stumbling block when attempting to read the response headers. 但是,在尝试读取响应标头时遇到了绊脚石。 HttpResponse.Headers is now only supported if you are running on IIS7 and in integrated pipeline mode. 现在,只有在IIS7上并以集成管道模式运行时,才支持HttpResponse.Headers。 I need this module to be installed in web applications hosted under IIS6, so I need an alternative way to get this information. 我需要将此模块安装在IIS6下托管的Web应用程序中,因此我需要一种替代方法来获取此信息。

What is the best way to achieve this? 实现此目标的最佳方法是什么?

Why do you as the server need to read them? 为什么您作为服务器需要阅读它们?

I recall being able to write them as far back as IIS 5 in the Page.Load event handler. 我记得可以在Page.Load事件处理程序中将它们写回到IIS 5。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以编程方式禁用IIS6应用程序(不是虚拟目录) - How do I programmatically disable IIS6 Applications (not virtual directories) 如何检测我当前运行的应用程序池? (IIS6) - How to detect what Application Pool I am currently running under? (IIS6) IIS6 应用程序池 state - IIS6 App Pool state 如何在IIS6上的ASP.NET中转发SOAP请求? - How to forward SOAP request in ASP.NET on IIS6? 如何在ASP.Net和IIS6中处理无扩展URL - How to deal with extensionless Url in ASP.Net and IIS6 如何使用.Net 4.0中包含的HttpClient类将文件上传到IIS Express中运行的Asp.Net MVC 4.0操作 - How to upload files to Asp.Net MVC 4.0 action running in IIS Express with HttpClient class included in .Net 4.0 如何使我的应用程序在带有oa配置文件的.NET 4.0和.NET 3.5上运行? - how do I get my app to run on .NET 4.0 and .NET 3.5 w/o a config file? 如何阅读资源txt文件的文本并将其放入C#.net 4.0 WPF中的TextBox中? - How do I read the text of a resource txt file and put it into a TextBox in C# .net 4.0 WPF? IIS6上运行的ASP.NET站点拒绝AppDomain卷影复制文件访问 - AppDomain shadow copied file access denied with ASP.NET site running on IIS6 如何在C#.NET 4.0应用程序中嵌入Kestrel WebServer - How do I Embed a Kestrel WebServer in a C# .NET 4.0 App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM