我想从Response Headers中删除有关IIS版本的信息。在Global.asax中是Application_PreSendRequestContent事件,或者我可以实现IHttpModule并在以下位置执行:
void context_PreSendRequestContent(object sender, EventArgs e)
{
HttpContext context = ((HttpApplication)sender).Context;
...
或
static void OnPreSendRequestHeaders(object sender, EventArgs e)
{
// remove the "Server" Http Header
HttpContext.Current.Response.Headers.Remove("Server");
但是当我想阅读context.Response.Headers属性时,我收到错误:{"This operation requires IIS integrated pipeline mode."}
。我有Windows XP和VS 2008.
由于