




































我的方法就是把上面注释的代码换成了它下面的
curContext.Response.Charset="utf-8";
curContext.Response.AppendHeader("Content-Disposition","attachment;filename=ganbuxinxi.xls");
curContext.Response.ContentEncoding=System.Text.Encoding.GetEncoding("GB2312");
curContext.Response.ContentType = "application/ms-excel";
还有人常会说我怎么改列名,其实改的方法也简单。就是在数据给datatable填充后用
dt.Columns["列名"].ColumnName="你想起的名称";
即可,例如下面的代码:






