110,538
社区成员
发帖
与我相关
我的任务
分享
StringWriter sw =new StringWriter();
sw.WriteLine("Name \t Age");//第一行为姓名年龄
sw.WriteLine("Tom \t 15");//第二行
Response.AddHeader("Content-Disposition", "attachment; filename=" + strName);
Response.ContentType = "application/ms-excel";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.Write(sw);
Response.End();