[研究]ASP.NET,Aspose.Cells 25.10.0 授權檔安裝與試用
2025-10-27
環境:Visual Studio 2022 + ASP.NET + WebForm + Web Application + C# + SQL Server 2019 + SQL Server Management Studio (SSMS) 20.2
********************************************************************************
如果沒有設定 Aspose License File 授權檔 (商業付費購買),產出的檔案會顯示 "Evaluation Only. Created with Aspose.Cells for .NET.Copyright 2003 - 2025 Aspose Pty Ltd.
********************************************************************************
(下圖) 授權檔案可以看出期限
Default.aspx.cs
using Aspose.Cells;
using System;
namespace WebApplication1
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// 如果沒有設定 Aspose License File,產出的檔案會
// 顯示 "Evaluation Only. Created with Aspose.Cells for .NET. Copyright 2003 - 2025 Aspose Pty Ltd.
// 讀取 .ods 檔案
Workbook workbook = new Workbook(@"C:\temp\input.ods"); // 替換為你的 .ods 檔案路徑
// 將 .ods 檔案儲存為 .xlsx 檔案
workbook.Save(@"C:\Temp\output.xlsx", SaveFormat.Xlsx); // 替換為你想要儲存的 .xlsx 檔案路徑
//-----
Aspose.Cells.License license = new Aspose.Cells.License();
string licenseFilePath = Server.MapPath("~/App_Data/") + "Aspose.Total.Product.Family.lic";
license.SetLicense(licenseFilePath); // 替換為你的授權檔案路徑
// 讀取 .ods 檔案
Workbook workbook2 = new Workbook(@"C:\temp\input.ods"); // 替換為你的 .ods 檔案路徑
// 將 .ods 檔案儲存為 .xlsx 檔案
workbook2.Save(@"C:\Temp\output2.xlsx", SaveFormat.Xlsx); // 替換為你想要儲存的 .xlsx 檔案路徑
}
}
}
|
下圖,評估版無法真正顯示內容;有商業付費 License 後則可以。
(完)
相關
(完)

沒有留言:
張貼留言