使用C#将表添加到第二张Excel表

我将数据从表中转储到运行时创build的Excel表单中。我在Session["Fullpath"]有文件path。 我可以用包含table1.now的数据创buildexcel,我还有一个表table2.I想把表table2中的数据转储到同一个excel的第二个表。

 Response.ClearContent(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment; filename= " + Session["Fullpath"]); Response.ContentType = "application/ms-excel"; Response.Charset = ""; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); table.RenderControl(htw); Response.Output.Write(sw.ToString()); System.IO.File.WriteAllText(Session["Fullpath"].ToString(), sw.ToString()); Response.Flush(); Response.End();