java license授权工具_种草文档管理工具Aspose.Total,速来领取正版许可

你是否在寻找功能强大的文档管理API?

别找了!全球超77%财富企业使用的文档开发工具——Aspose全系列!

所有你想要的Aspose工具——Aspose.Total

Aspose.Total是一个完整的文档管理工具包,可让您创建,操作和转换各种Microsoft Office文档格式、开放格式、可移植、Web和图像格式,同时还使您可以处理电子邮件,OCR,3D和条形码等等。不仅如此,Aspose.Total适用于.NET、Java、C++、SharePoint、Android via Java等共10种语言平台。

2020·Aspose.Total最新产品线

8d581f5a9a17ce00bf74c06d36ac136c.png

自Aspose系列上线以来,深受广大用户朋友的欢迎。作为全产品完整套包Aspose.Total已升级到v2020.6(点击文末“了解更多”下载安装最新版)。

相信很多朋友已经下载Aspose测试过,但是发现有水印、文件限制大小等等功能无法实现,没错,这些是厂商的保护措施。为了让广大开发人员能够更加畅快的体验Aspose的强大功能,慧都特为大家准备30天临时许可!

>>加入Aspose控件QQ交流群(642018183)即可获取最新临时许可,免费体验!<<


不管是购买了永久授权还是使用临时许可证的初学者都会遇到该如何正确使用许可证的问题,下面为大家介绍如何调用许可证。

何时需要许可证

请遵循以下简单规则:

  • 每个应用程序域只需设置一次许可证。
  • 在使用任何其他Aspose.Words类之前,您需要设置许可证。

应用许可证

可以从不同位置申请许可证:

  • 显式路径。
  • 包含Aspose.Words.dll文件的文件夹。
  • 该文件夹包含名为Aspose.Words.dll的程序集。
  • 包含条目程序集(您的.exe)的文件夹。
  • 程序集中的嵌入式资源,称为Aspose.Words.dll。

当您在应用程序中引用Aspose.Words.dll时,该库将被复制到您的输出目录中(除非该条目的属性中的Copy Local设置为false)。在输出.exe和该位置的Aspose.Words.dll旁边包括许可证。

使用License.SetLicense方法许可组件。通常,设置许可证的最简单方法是将许可证文件与Aspose.Words.dll放在同一文件夹中,并仅指定文件名,而不带路径。

使用文件或流对象应用许可证(以Aspose.Words为例)

多次调用License.SetLicense无害,只是浪费处理器时间。

如果要开发Windows窗体或控制台应用程序,请在使用Aspose.Words类之前在启动代码中调用License.SetLicense。

开发ASP.NET应用程序时,可以在受Application_Start保护的方法中从Global.asax.cs(Global.asax.vb)文件调用License.SetLicense。应用程序启动时将调用一次。不要从Page_Load方法中调用License.SetLicense,因为这意味着每次加载网页时都会加载许可证。

如果要开发类库,则可以从使用Aspose.Words的类的静态构造函数中调用License.SetLicense。静态构造函数将在创建类实例之前执行,以确保正确设置Aspose.Words许可证。

从文件加载许可证:在此示例中,Aspose.Words尝试在嵌入式资源或程序集文件夹中查找许可证文件。

Aspose.Words.License license = new Aspose.Words.License();// This line attempts to set a license from several locations relative to the executable and Aspose.Words.dll.// You can also use the additional overload to load a license from a stream, this is useful for instance when the // license is stored as an embedded resourcetry{    license.SetLicense("Aspose.Words.lic");    Console.WriteLine("License set successfully.");}catch (Exception e){    // We do not ship any license with this example, visit the Aspose site to obtain either a temporary or permanent license.     Console.WriteLine("There was an error setting the license: " + e.Message);}

从流对象加载许可证:初始化流中的许可证

Aspose.Words.License license = new Aspose.Words.License();try{    // Initializes a license from a stream     MemoryStream stream = new MemoryStream(File.ReadAllBytes(@"Aspose.Words.lic"));    license.SetLicense(stream);    Console.WriteLine("License set successfully.");}catch (Exception e){    // We do not ship any license with this example, visit the Aspose site to obtain either a temporary or permanent license.     Console.WriteLine("There was an error setting the license: " + e.Message);}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值