Excel导出 乱码解决问题

it2022-05-05  162

Excel导出 乱码解决问题 //导出方法 标题乱码 context.Response.ClearContent(); context.Response.AddHeader("content-disposition", "attachment; filename=" + HttpUtility.UrlEncode("XXXX" + DateTime.Now.ToString("hhMMss"), System.Text.Encoding.UTF8) + ".xls"); context.Response.ContentType = "application/excel"; context.Response.Write(GetGridTableHtml2(context)); context.Response.End();

  

//内容乱码 sb.Append("<meta http-equiv=\"content-type\" content=\"application/ms-excel; charset=UTF-8\"/>");

  

posted on 2017-05-31 18:24 Apex_233 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/Apex233/p/6925445.html


最新回复(0)