对于部分用户来说,青睐Aspose强大的功能和广泛的适用格式,因此需要通过试用来测试是否满足功能要求。福利来啦!Aspose30天正版许可让你畅快体验它的强大功能!30天很短,还不赶快来领!
你是否在寻找功能强大的文档管理API/span>
别找了!全球超77%财富企业使用的文档开发工具——Aspose全系列!
所有你想要的Aspose工具——Aspose.Total
Aspose.Total是一个完整的文档管理工具包,可让您创建,操作和转换各种MicrosoftOffice文档格式、开放格式、可移植、Web和图像格式,同时还使您可以处理电子邮件,OCR,3D和条形码等等。不仅如此,Aspose.Total适用于.NET、Java、C++、SharePoint、Android via Java等共10种语言平台。
2020·Aspose.Total最新产品线
自Aspose系列上线以来,深受广大用户朋友的欢迎。作为全产品完整套包Aspose.Total已升级到v2020.6(安装最新版)。
相信很多朋友已经下载Aspose测试过,但是发现有水印、文件限制大小等等功能无法实现,没错,这些是厂商的保护措施。为了让广大开发人员能够更加畅快的体验Aspose的强大功能,特为大家准备30天临时许可!
>>扫描下方二维码加入Aspose控件交流群即可获取最新临时许可,免费体验!<<

不管是购买了永久授权还是使用临时许可证的初学者都会遇到该如何正确使用许可证的问题,下面为大家介绍如何调用许可证。
何时需要许可证
请遵循以下简单规则:
- 每个应用程序域只需设置一次许可证。
- 在使用任何其他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("nThere 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("nThere was an error setting the license: " + e.Message);}
还想要更多吗可以点击阅读【2019 · Aspose最新资源整合】,查找需要的教程资源。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!