[英]C# How to open a file(workbook) which u saved in a MemoryStream without having it saved actually in a server?
I want to Open a file (show an Excel file for user) without having it saved in my computer/server to open it from memory. 我想打开一个文件(显示用户的Excel文件)而不将其保存在我的计算机/服务器中以从内存中打开它。 So far i came up with this code which saves file to MemoryStream:
到目前为止,我想出了这个将文件保存到MemoryStream的代码:
MemoryStream memoryStream = new MemoryStream();
wb.SaveAs(memoryStream);
So how to open/show a Excel file which is saved in the memory stream 那么如何打开/显示保存在内存流中的Excel文件
The Excel application can't read from a MemoryStream. Excel应用程序无法从MemoryStream中读取。
You will have to write the file onto disk, maybe into a temporary directory. 您必须将文件写入磁盘,也可以写入临时目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.