Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在c#代码隐藏中连续打开2个excels_C#_Asp.net_Export To Excel - Fatal编程技术网

如何在c#代码隐藏中连续打开2个excels

如何在c#代码隐藏中连续打开2个excels,c#,asp.net,export-to-excel,C#,Asp.net,Export To Excel,我想用c#连续打开两个excel工作簿(一个接一个)。我怎样才能做到这一点?? 我以前是这样的: Response.ContentType = "application/vnd.ms-excel"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + File1 + ".xls"); Response.TransmitFile(savepath); HttpContext.Current.Applicati

我想用c#连续打开两个excel工作簿(一个接一个)。我怎样才能做到这一点?? 我以前是这样的:

Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + File1 + ".xls");
Response.TransmitFile(savepath);
HttpContext.Current.ApplicationInstance.CompleteRequest();

Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + File2 + ".xls");
Response.TransmitFile(savepath);
HttpContext.Current.ApplicationInstance.CompleteRequest();
但是,只有一个excel被传输,我如何才能得到第二个呢


“提前感谢”

HTTP在这方面受到限制,每个请求只能处理一个响应-您需要考虑其他方法来实现这一点,例如通过客户端脚本发出多个请求,或者将您的文件合并到单个存档文件(如ZIP文件)在传输之前

作为一个想法,您可以将两个excel文件合并为一个单独的表格。

我没有看到文件下载支持在web上一次单击多个文件,除非已压缩。您好,您能给我发送压缩多个excel表格的代码库吗。我在谷歌上搜索了一下,什么都没找到。请寄给我代码库。非常紧急,非常感谢您的帮助。