直接贴代码:
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();
本文介绍了一种使用ASP.NET将HTML内容导出为Word文档的方法,包括设置响应头、指定字符集及内容编码等步骤。
1197

被折叠的 条评论
为什么被折叠?



