1、创建项目
dotnet new console -o myApp
cd myApp
2、在https://www.nuget.org/packages中搜索转换库Spire.XLS结果如下:

3、执行命令
dotnet add package Spire.XLS --version 9.11.14
4、主程序Program.cs内容如下:
using System;
using Spire.Xls;
namespace myApp
{
class Program
{
static void Main(string[] args)
{
// create a new excel document
Workbook book = new Workbook();
//load a document from file
book.LoadFromFile("Input.xls");
//Save the file to the version you want
book.SaveToFile("Output.xlsx", ExcelVersion.Version2013);
}
}
}
5、编译release版本
dotnet build --configuration Release
网友评论