使用ASP.NET C将excel文件即.xls文件转换为.mht文件的代码 [英] Code to convert excel file i.e., .xls file to .mht file using ASP.NET C#

查看:80
本文介绍了使用ASP.NET C将excel文件即.xls文件转换为.mht文件的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用asp.net将Excel文件即.xlS文件转换为.mht文件的代码c#





我尝试过:



将Excel文件即.xlS文件转换为.mht文件的代码asp.net c#

解决方案

这不是订购代码服务:我们不会为你工作。

如果你想要有人写你的代码,你必须付钱 - 我建议你去Freelancer.com并在那里问。



但是意识到:你得到了你付出的代价。支付花生,买猴子。



发展的概念就像这句话所暗示的那样:系统地运用科学和技术知识来满足特定的目标或要求。 BusinessDictionary.com [ ^ ]

这与有一个不一样快速谷歌并放弃,如果我找不到完全正确的代码。

所以要么付钱给别人去做,要么学会如何自己写。我们不是为你做的。


Quote:

转换Excel文件的代码即ie ,.xml文件到.mht文件使用asp.net c#



- 解决方案1:开始做功课。

- 解决方案2:学习Google。

- 解决方案3:聘请专业人士。

引用:

如果你不是能够回答我的问题。不需要提供免费的建议。



如果您对这些答案不满意,请尝试付费服务。


关闭通过使用

Microsoft.Office.Interop.Excel 命名空间

< a href =https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel?view=excel-pia> Microsoft.Office.Interop.Excel命名空间| Microsoft Docs [ ^ ]

1.使用Workbooks集合 Open()方法打开Excel文件。

2.使用 SaveAs()方法将文件保存为其他类型。



现在计划中的扳手;两者都没有通用的答案:

1. XML不是Excel文件类型。虽然它可以打开它,但可能会有一些关于如何处理值/数据的决定。

2. MHT不是Excel输出类型。



对于XML问题,它将取决于它的排列方式以及您希望用它完成的工作。是否有BLOB数据要重建为图像?是XML元素中的值还是属性值。只有你可以回答这些问题。



然后有MHT(微软超文本),它本质上是一个存档的网页。对此唯一的赎回是使用MIME标准,本质上是一个具有不同扩展名的EML文件。有几个选项

1.在您的应用程序中嵌入一个Web浏览器,打开SavedAs html页面并重新保存为存档。

2.使用CDO(协作数据对象)并使用 CreateMHTMLBody 方法保存。



所以你需要进行一些数据分析和研究。

Code to convert Excel file i.e., .xlS file to .mht file using asp.net c# 



What I have tried:

Code to convert Excel file i.e., .xlS file to .mht file using asp.net c# 

解决方案

This is not a "code to order" service: we do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there.

But be aware: you get what you pay for. Pay peanuts, get monkeys.

The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".
So either pay someone to do it, or learn how to write it yourself. We aren't here to do it for you.


Quote:

Code to convert Excel file i.e., .xml file to .mht file using asp.net c#


- Solution 1: Start working on your homework.
- Solution 2: Learn Google.
- Solution 3: Hired a professional.

Quote:

If you are not able to answer my Questions.No need to give free suggestions.


If you are unhappy with those answers, try paid service.


A close to what you want solution can be put together by using the
Microsoft.Office.Interop.Excel namespace
Microsoft.Office.Interop.Excel Namespace | Microsoft Docs[^]
1. Open an Excel file using the Workbooks collection Open() method.
2. Save the file to a different type using the SaveAs() method.

Now for the wrenches in your plan; neither of which has a universal answer:
1. XML is not an Excel file type. While it can open it there may be some "decisions" made on how to handle the values/data.
2. MHT is not an Excel output type.

For the XML problem, it is all going to depend on how it is arranged and what you want done with it. Is there BLOB data you want reconstituted as images? Are the values within the XML elements or are they attribute values. Only you can answer these questions.

And then there is MHT (Microsoft Hyper Text), which is essentially an archived webpage. The only redeeming thing for this is that uses the MIME standards and is essentially an EML file with a different extension. There are a couple of options
1. Embed a web-browser in your application to open the SavedAs html page and resave as an archive.
2. Utilize a CDO (Collaborative Data Objects) and save using the CreateMHTMLBody method.

So you have a little bit of data analysis and research to do.


这篇关于使用ASP.NET C将excel文件即.xls文件转换为.mht文件的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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