C# 将HTML转为Word

 时间:2024-11-03 23:28:38

1、在VS程序中打开“解决方案资源管理器”,鼠标右键点击“引用”,“管理NuGet包”:

C# 将HTML转为Word

2、点击“搜索”,在搜索框中输入搜索内容,点击包,安装:

C# 将HTML转为Word

3、依次点击“OK”,"我接受",等待程序安装。

C# 将HTML转为Word

4、完成安装后,执行如下程序代码,将html转为Word:using Spire.Doc;namespace HTMLtoWord{ class Program { static void Main(string[] args) { //创建 Document 对象 Document document = new Document(); //加载HTML文件 document.LoadFromFile("sample.html"); //将HTML文件转为Word并保存 document.SaveToFile("HtmltoWord.docx", FileFormat.Docx2013); System.Diagnostics.Process.Start("HtmltoWord.docx"); } }}

  • 想要自己制作U起做系统,简单几部成为大师!
  • 批处理-ip地址显示
  • 火狐浏览器插件(user-agent)模拟手机和操作系统
  • 安卓/苹果手机共享Mac电脑网络
  • Firefox如何进行同步设置
  • 热门搜索
    护发精油什么牌子好 please是什么意思 五行是什么意思 自负盈亏是什么意思 吹哨人是什么意思 苹果醋有什么用 negro什么意思 什么是白喉 脑死亡是什么意思 妖娆的意思