找回密码
 立即注册

QQ登录

只需一步,快速开始

Richard.Ma 讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2023-11-21 11:55  /   查看:885  /  回复:0
本帖最后由 Richard.Ma 于 2023-11-22 14:02 编辑

要在 GcExcel .NET 中应用正式授权/临时授权,需要按照使用的环境通过以下两种方式之一将授权长字符串复制到代码中。


.NET Core/Framework 控制台程序
    1.许可项目中的所有工作簿
  1. Workbook.SetLicenseKey("你<span style="color: rgb(54, 54, 54); font-family: &quot;Microsoft Yahei&quot;, Simsun; font-size: 14px;">申请的授权</span>");
复制代码
   2.
许可单个工作簿的实例
  1. var workbook = new Workbook("你<span style="color: rgb(54, 54, 54); font-family: &quot;Microsoft Yahei&quot;, Simsun; font-size: 14px;">申请的授权</span>");
复制代码


.NET Core MVC 应用
    1.若要许可项目中的所有工作簿,请使用 SetLicenseKey 方法在 Startup.cs 文件中添加许可证密钥。这将许可所有工作簿,甚至跨多个 Controller。
  1. public Startup(IConfiguration configuration)
  2.         {
  3.             //Apply license before using the API, otherwise it will be considered as no license.
  4.             Workbook.SetLicenseKey(你申请的授权");
复制代码
   2.若要许可单个工作簿的实例,请在创建工作簿实例时添加许可证密钥,在控制器的 Index() 方法中添加以下代码:
  1. public IActionResult Index()
  2.         {
  3.             //Apply license before using the API, otherwise it will be considered as no license.
  4.             var workbook = new Workbook("你申请的授权");
复制代码




0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部