62,074
社区成员
发帖
与我相关
我的任务
分享
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.Buffer = true;
System.Web.HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
System.Web.HttpContext.Current.Response.Charset = "GB2312";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
System.Web.HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + MainID + SubID + Date + ".xls");
System.Web.HttpContext.Current.Response.Write(content.ToString());
System.Web.HttpContext.Current.Response.End();