IRONSOFTWAREHOME

IronXL 支援 .NET Core 的 AWS Lambda 功能

Curtis Chau
Curtis Chau
Updated: 2026年4月22日

IronXL 完全支援 .NET Standard 程式庫、Core 應用程式、.NET 5 和 .NET 6 專案的 AWS Lambda 功能。

要新增 AWS Toolkit for Visual Studio,請按此鏈結:使用 AWS Toolkit for Visual Studio 的 AWS Lambda 模板

將 AWS Toolkit 安裝到 Visual Studio 可讓您建立一個 AWS Lambda 功能專案。 您可以透過此鏈結了解如何使用 Visual Studio 建立 AWS Lambda 功能專案。

運作中的 AWS Lambda 功能程式碼範例

在建立新 AWS Lambda 功能專案後,您可以嘗試此程式碼片段:

using System;
using Amazon.Lambda.Core;
using IronXL;

// Ensure this attribute targets your Lambda function
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]

namespace AWSLambdaIronXL
{
    public class Function
    {
        /// <summary>
        /// A simple function that takes a string input and processes it using IronXL.
        /// This specific example creates a new Excel workbook and fills cells with labeled values.
        /// </summary>
        /// <param name="input">The string input for the function</param>
        /// <param name="context">The Lambda context</param>
        /// <returns>A Base64 string representation of the Excel file</returns>
        public string FunctionHandler(string input, ILambdaContext context)
        {
            // Create a new workbook with ExcelFileFormat.XLS
            WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLS);
            
            // Create a new worksheet named "new_sheet"
            var newSheet = workBook.CreateWorkSheet("new_sheet");
            
            string columnNames = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            foreach (char col in columnNames)
            {
                for (int row = 1; row <= 50; row++)
                {
                    // Construct cell name and fill it with data
                    var cellName = $"{col}{row}";
                    newSheet[cellName].Value = $"Cell: {cellName}";
                }
            }

            // Convert the entire workbook to a byte array and then to a Base64 string
            return Convert.ToBase64String(workBook.ToByteArray());
        }
    }
}

IronXL NuGet 套件可用於部署的說明已在我們的 IronXL NuGet 安裝指南 中記錄。

常見問題

我可以如何在Visual Studio中建立AWS Lambda Function專案?

要在Visual Studio中建立AWS Lambda Function專案,請安裝Visual Studio的AWS工具套件。這將使您能夠使用AWS Lambda模板進行專案開發。您可以在AWS文件中找到詳細的指示。

IronXL在AWS Lambda中的範例應用程式是什麼?

IronXL在AWS Lambda中的一個範例應用程式是建立一個新的Excel工作簿,使用標籤資料填充它,並返回該Excel文件的Base64字串。這演示了IronXL如何在AWS Lambda functions中操作Excel文件。

我如何使用IronXL在AWS Lambda中將Excel工作簿轉換為Base64?

在AWS Lambda function中使用IronXL,您可以建立工作簿並使用workBook.ToByteArray()將其轉換為位元組陣列。然後使用Convert.ToBase64String()獲取該工作簿的Base64字串表示形式。

IronXL可以在AWS Lambda Functions中與.NET 5一起使用嗎?

是的,IronXL完全支援AWS Lambda Functions for .NET 5,還有.NET Standard Libraries、Core應用程式和.NET 6專案。

我可以在哪裡找到IronXL與AWS Lambda部署的資源?

IronXL與AWS Lambda部署的資源可以在IronXL NuGet安裝指南中找到,該指南提供使用IronXL NuGet套件進行部署的文件。

我如何在使用IronXL於AWS Lambda中排查問題?

確保您安裝了正確版本的IronXL和AWS工具套件。檢查程式碼是否有語法錯誤,並參考IronXL的文件以獲取與AWS Lambda的相容性詳情。

What AWS resource can I use for detailed instructions on deploying an IronXL project in AWS Lambda?

Detailed instructions for deploying an IronXL project as an AWS Lambda function can be found in the AWS documentation under AWS Lambda Templates in the AWS Toolkit for Visual Studio.

Where can I find the IronXL NuGet installation guide?

The IronXL NuGet installation guide is available under the documentation section on Iron Software's website, specifically in the IronXL NuGet installation guide.

How do I create a new worksheet in an Excel workbook using IronXL?

In IronXL, you can create a new worksheet in an Excel workbook using the CreateWorkSheet method. For example, `var newSheet = workBook.CreateWorkSheet("new_sheet");` creates a sheet named 'new_sheet'.

What is the benefit of using IronXL with AWS Lambda?

Using IronXL with AWS Lambda allows seamless integration of .NET applications with AWS cloud services, enabling programmatic creation and manipulation of Excel files in serverless environments.

Curtis Chau
技術作家

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

...
閱讀更多

準備好開始了嗎?

Nuget Downloads 2,237,574版本:2026.9剛剛發布

立即獲取您的免費30天試用金鑰
無需信用卡或帳戶建立
PDF的C# NuGet程式庫
NuGet安裝

版本: 2026.9

PM > Install-Package IronXL.Excel
nuget.org/packages/IronXL.Excel/
  1. 在方案資源管理器中,右鍵單擊參考,管理NuGet包
  2. 選擇瀏覽並搜尋“IronXL”
  3. 選擇包並安裝
C# PDF DLL
下載DLL

版本: 2026.9

  1. 下載並解壓IronXL到您的方案目錄中的比如~/Libs位置
  2. 在Visual Studio方案資源管理器中,右鍵單擊參考。選擇瀏覽,“IronXL.dll”

授權從$999

有問題嗎?聯絡我們的開發團隊。

Key in blue circle

立即免費取得 30 天試用金鑰

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
預約您的免費即時演示
Booking Badge

全球數百萬工程師的信賴

Iron Software的客戶標誌
獲得無義務諮詢
填寫以下表格或電郵sales@ironsoftware.com
您的資料將始終保密。
全球數百萬工程師的信賴
Iron Software的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立