if (context.Request.UserAgent.ToLower(Indem. msie", System.StringComparison.Ordinal) > -1)//IE瀏覽器
{
context.Response.AddHeader("content-disposition", "filename=" HttpUtility.UrlEncode(filefileName));
}
if (context.Request.UserAgent.ToLower().IndexOf("firefox", System.StringComparison.Ordinal) > -1)//firefox瀏覽器
{
Response.AddHeader("content-disposition", "attachment;filename="" fileName """);
}
else//其他瀏覽器
{
content-disposition", "attachment;filename=" fileName);
}
context.Response.ContentType = "application/x-xls";