asp.net生成execel文件打开时,薄名和title名都是乱码。
LGame 2007-01-15 04:54:43 asp.net生成execel文件打开时,薄名和title名都是乱码。
内容是正确的!
我的代码是这样的,
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(csvfilename + ".csv", Encoding.UTF8));
HttpContext.Current.Response.BinaryWrite(Encoding.Default.GetBytes(csvcontent));
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Close();
考了一段别人的asp的代码,就没有问题,
帮帮我,感谢大家了!!