------------Asp.Net如何将网页及图片一并导出到Word中?----------
目前可以实现非图片的导出,如果网页中有图片到Word中就是一个红叉,请问如何解决?
以下是导出代码:
//功能实现 public static void ToWord(System.Web.UI.Control ctl) { HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Charset = ""; HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=DocLibrary.doc"); HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); HttpContext.Current.Response.ContentType = "application/ms-word"; ctl.Page.EnableViewState = false; System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); ctl.RenderControl(hw); HttpContext.Current.Response.Write(tw.ToString()); HttpContext.Current.Response.End(); } //调用 Tools.ToWord(this.div1);