HttpContext.Current.Response.ContentType = "application/octet-stream";
//通知浏览器下载文件而不是打开
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode("名单模版.xls", System.Text.Encoding.UTF8));
HttpContext.Current.Response.BinaryWrite(by);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();