تحديد ما إذا تم تحميل الترخيص بنجاح
Contents
[
Hide
]
يوفر Aspose.Cellsمصنف الخاصية التي يمكنك استخدامها لتحديد ما إذا تم تحميل الترخيص بنجاح أم لا. إذا قمت بالوصول إلى هذه الخاصية قبل تعيين الترخيص ، فسوف تعودخاطئةوإذا اتصلت بهذه الخاصية بعد تعيين الترخيص ، فسوف تعودحقيقي مشيرا إلى أنه تم تحميل الترخيص بنجاح.
C# كود لتحديد ما إذا تم تحميل الترخيص بنجاح
الكود التالي يصل إلىمصنف الملكية قبل تحديد الترخيص وإعادتهخاطئة . ثم يقوم بتحميل الترخيص والوصول إلى العقار مرة أخرى والذي يعود الآنحقيقي.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the License File | |
string licPath = @"Aspose.Cells.lic"; | |
// Create workbook object before setting a license | |
Workbook workbook = new Workbook(); | |
// Check if the license is loaded or not. It will return false | |
Console.WriteLine(workbook.IsLicensed); | |
try | |
{ | |
Aspose.Cells.License lic = new Aspose.Cells.License(); | |
lic.SetLicense(licPath); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} | |
// Check if the license is loaded or not. Now it will return true | |
Console.WriteLine(workbook.IsLicensed); |
إخراج وحدة التحكم
هنا هو إخراج وحدة التحكم (التصحيح) من نموذج التعليمات البرمجية أعلاه
False
True