谁能帮助我,我是初学者,不知道如何进行转换。
这是我的代码:
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;filename=" + filename + ".xls");
Response.ContentType = "application/vnd.ms-excel";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Charset = "";
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
Response.ContentEncoding = System.Text.Encoding.Unicode;
fuFile.RenderControl(hw);
Response.Output.Write(sw.ToString().Replace(" ", "").Replace("&", "&"));
Response.End();
这还不足以将 HTML 文件导出到 Excel 吗?