日期:2014-05-18 浏览次数:20473 次
System.IO.StringWriter sw = new System.IO.StringWriter(); sw.Write("<td style=\"width:40px; text-align:center; vertical align:middle;font-size:15px; font-weight: bold; height:49px;\">" + 0 + "</td>"); sw.Close(); Response.Clear(); Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); Response.AddHeader("Content-Disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("测试", System.Text.Encoding.UTF8) + DateTime.Now.ToShortDateString() + ".xls"); Response.ContentType = "application/ms-excel"; Response.Write(sw); Response.End();