在上传时单击服务器中的文件,同时将其转换为数据集 [英] Coping a file in server on upload click and simultaneously conevrt itn to a dataset

查看:92
本文介绍了在上传时单击服务器中的文件,同时将其转换为数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在服务器的任何文件夹中复制具有不同名称的excel文件?

How should i copy a excel file with a different name in the server any folder?

推荐答案

如果使用Visual Studio .NET,可能会添加引用一个项目通过项目|添加参考菜单选择。 添加引用窗口中的COM选项卡提供对系统上安装的COM库的访问。



Excel列为Microsoft.Excel,具体名称取决于已安装Excel版本。如果您的系统上有Excel 2003,则COM库将列为Microsoft.Excel 11.0对象库。此外,还需要两个名称空间:



Microsoft.Office.Interop.Excel:允许您通过.NET互操作使用Excel对象。

System.Runtime.InteropServices:包含COMException类,允许您正确处理与COM相关的异常。
If using Visual Studio .NET, a reference may be added to a project via the Project | Add Reference menu selection. The COM tab within the Add Reference window provides access to COM libraries installed on the system.

Excel is listed as Microsoft.Excel, and the specific name will depend on the Excel version installed. If you have Excel 2003 on my system, so the COM library is listed as Microsoft.Excel 11.0 Object Library. In addition, two namespaces are necessary:

Microsoft.Office.Interop.Excel: Allows you to work with Excel objects via .NET interop.
System.Runtime.InteropServices: Includes the COMException class, allowing you to properly handle COM-related exceptions.


这篇关于在上传时单击服务器中的文件,同时将其转换为数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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