关于C#导出的WORD中加入页眉页脚
Response.Clear();
Response.Buffer = true;
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/vnd.ms-words";
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("test.doc", System.Text.Encoding.UTF8));
StringBuilder sb = new StringBuilder();
this.EnableViewState = false;
System.IO.StringWriter SW = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter HTW = new System.Web.UI.HtmlTextWriter(SW);
Page.RenderControl(HTW);
Response.Write(SW.ToString());
Response.Flush();
Response.Close();
这是代码:
如何加页眉页脚的代码,谢谢