导出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"; 

string title= "t1"+"\t"+"t2"+"\n";
response.write(title);
string content= "c1"+"\t"+"c2"+"\n";
response.write(content);
response.end();

你可能感兴趣的:(导出Excel)