日期:2014-05-18  浏览次数:20427 次

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