当前位置: 代码迷 >> ASP.NET >> csv出力sheet名的有关问题
  详细解决方案

csv出力sheet名的有关问题

热度:10205   发布时间:2013-02-25 00:00:00.0
csv出力sheet名的问题
csv出力时,点保存时sheet名正常(名字为application),但点打开时sheet名就不正常(名字为.csv]application[1])以下是部分代码供参考。谁能帮我解决下让sheet名正常显示,急!!!!

Encoding encoding = Encoding.GetEncoding("Shift-JIS");
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" +
HttpUtility.UrlEncode("application"+ ".csv", System.Text.Encoding.UTF8));
HttpContext.Current.Response.ContentType = "application/ms-excel";
HttpContext.Current.Response.BinaryWrite(encoding.GetBytes("内容"));
HttpContext.Current.Response.End();

------解决方案--------------------------------------------------------
友情UP
  相关解决方案