Lisansın başarıyla yüklenip yüklenmediğini belirleme

Lisansın başarıyla yüklenip yüklenmediğini belirlemek için C# kodu

Aşağıdaki kod,Workbook.IsLicensed bir lisans ayarlamadan önce mülk ve geri dönerYANLIŞ . Ardından lisansı yükler ve şimdi geri dönen mülke tekrar erişir.doğru.

// 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);

Konsol Çıkışı

İşte yukarıdaki örnek kodun konsol (hata ayıklama) çıktısı

False

True