62,046
社区成员
发帖
与我相关
我的任务
分享
protected void Application_EndRequest(object sender, EventArgs e)
{
HttpContext.Current.Response.Write("1234567");
}
if (!context.Request.UserAgent.ToLower().Contains("konqueror") )
{
if (context.Request.Headers["Accept-encoding"] != null && context.Request.Headers["Accept-encoding"].Contains("gzip"))
{
context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress, true);
context.Response.AppendHeader("Content-encoding", "gzip");
}
else if (context.Request.Headers["Accept-encoding"] != null && context.Request.Headers["Accept-encoding"].Contains("deflate"))
{
context.Response.Filter = new DeflateStream(context.Response.Filter, CompressionMode.Compress, true);
context.Response.AppendHeader("Content-encoding", "deflate");
}
}
以上这段是对hander的encoding进行处理, 于是我屏蔽此段,yes 没有错,任何浏览器都OK了;
void context_EndRequest(object sender, System.EventArgs e)
{
HttpApplication app = sender as HttpApplication;
for (int i = 0; i < app.Context.Response.Cookies.Count; i++)
{
if (app.Context.Response.Cookies[i].Name.Equals("ASP.NET_SessionId"))
{
app.Context.Response.Cookies[i].Domain = m_RootDomain;
break;
}
app.Context.Response.Write("我想输出的东西");
}
}