response导出html到word

来源:互联网 发布:尼古丁 贴片 危害 知乎 编辑:程序博客网 时间:2024/06/02 22:44

直接贴代码:

       Response.AppendHeader("Content-Disposition", "attachment;filename=result.doc");                    Response.ContentType = "application/ms-word";                    Response.Charset = "GB2312";                    Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");                    Response.Write("<html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" xmlns:m=\"http://schemas.microsoft.com/office/2004/12/omml\" xmlns=\"http://www.w3.org/TR/REC-html40\">");                    Response.Write(item.ResumeHtml);                    Response.Write("</html>");                    Response.End();