如何从下载链接(URL)读取excel文件中的数据而不实际下载文件 [英] How to read data from an excel file from the download link(URL) without actually downloading the file

查看:404
本文介绍了如何从下载链接(URL)读取excel文件中的数据而不实际下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些用于下载excel文件的URL。我必须将来自所有excel文件的数据合并到1个excel文件中并下载(不实际下载单个文件)。



任何人都可以帮我这个吗?



提前致谢。

I have certain URLs for downloading the excel files. I have to combine data from all the excel files into 1 excel file and download( without actually downloading the individual files).

Can anyone help me with this?

Thanks in advance.

推荐答案

请参阅相关的链接。



Excel c#.net在不在后台打开Excel的情况下检索数据 [ ^ ]



希望这可以帮助你...
Refer the link which takes care of the same.

Excel c#.net retrieving data without opening excel in the background[^]

Hope this helps you...


您需要一个用于读取和写入Excel文件的工具。不要使用Excel本身,从IIS调用时可能会导致问题。使用该工具,打开单个文件,并创建一个新的Excel工作簿,您可以根据需要在其中添加数据(例如,只需复制所有工作表)。然后将文件放入可以通过Web访问的位置,并在网页中添加一个链接。

注意:创建新文件可能需要一些时间,具体取决于更新对于组合文件的单个文件和请求,可能适合检查是否需要再次创建,或者可以检索以前创建的文件。
You need a tool for reading and writing excel files. Do not use Excel itself, it may cause problems when called from IIS. With that tool, open the individual files, and create a new excel workbook into which you add the data depending on your requirements (e.g. just copying over all of the worksheets). Then place the file into a position which can be accessed via the web, and add a link to it in the web page.
Note: creating that new file might take some time, and depending on the updates of the individual files and requests of the combined file, it might be appropriate to check if the creation needs to be done again, or a previously created file could be retrieved.


WebClient wc = new WebClient();

byte [] data = wc.DownloadData(url);






下载数据,可以使用filestream
WebClient wc = new WebClient();
byte[] data = wc.DownloadData(url);



This downloads the data and it can be written files using filestream

这篇关于如何从下载链接(URL)读取excel文件中的数据而不实际下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆