IronXL 对 AWS Lambda 功能以 .NET Core 支持
IronXL完全支持用于.NET Standard库、Core应用程序、.NET 5和.NET 6项目的AWS Lambda函数。
要添加AWS ToolKit for visual studio,请跟随此链接。在面向 Visual Studio 的 AWS 工具包中使用 AWS Lambda 模板
将 AWS ToolKit 安装到 Visual Studio 中可以让您创建 AWS Lambda 函数项目。 您可以学习如何使用Visual Studio创建AWS Lambda函数项目。链接
工作中的AWS Lambda函数代码示例
在创建新的AWS Lambda函数项目后,您可以尝试此代码片段
namespace AWSLambdaIronXL
{
public class Function
{
/// <summary>
/// A simple function that takes a string and does a ToUpper
/// </summary>
/// <param name="input"></param>
/// <param name="context"></param>
/// <returns></returns>
public string FunctionHandler(string input, ILambdaContext context)
{
WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLS);
var newSheet = workBook.CreateWorkSheet("new_sheet");
string ColumnsNames = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
foreach (char col in ColumnsNames)
{
for (int row = 1; row <= 50; row++)
{
var cellName = $"{col}{row}";
newSheet [cellName].Value = $"Cell : {cellName}";
}
}
return Convert.ToBase64String( workBook.ToByteArray());
}
}
}
namespace AWSLambdaIronXL
{
public class Function
{
/// <summary>
/// A simple function that takes a string and does a ToUpper
/// </summary>
/// <param name="input"></param>
/// <param name="context"></param>
/// <returns></returns>
public string FunctionHandler(string input, ILambdaContext context)
{
WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLS);
var newSheet = workBook.CreateWorkSheet("new_sheet");
string ColumnsNames = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
foreach (char col in ColumnsNames)
{
for (int row = 1; row <= 50; row++)
{
var cellName = $"{col}{row}";
newSheet [cellName].Value = $"Cell : {cellName}";
}
}
return Convert.ToBase64String( workBook.ToByteArray());
}
}
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
IronXL NuGet 软件包可用于我们的IronXL NuGet 安装指南.