导出excel乱码问题(小技巧)
System.Web.HttpResponse httpResponse = Page.Response;
httpResponse.AppendHeader(“Content-Disposition”,”attachment;filename=”+HttpUtility.UrlEncode(fileName,System.Text.Encoding.UTF8));
httpResponse.ContentEncoding=System.Text.Encoding.GetEncoding(“BIG5”);
httpResponse.ContentType =”application/ms-excel”;
httpResponse.AppendHeader(“Content-Disposition”,”attachment;filename=”+HttpUtility.UrlEncode(fileName,System.Text.Encoding.UTF8));
httpResponse.ContentEncoding=System.Text.Encoding.GetEncoding(“BIG5”);
httpResponse.ContentType =”application/ms-excel”;
string title= “t1″+”\t”+”t2″+”\n”;
response.write(title);
string content= “c1″+”\t”+”c2″+”\n”;
response.write(content);
response.end();
版权声明:本文为cuihongyu3503319原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。