App.xaml.cs 913 B

12345678910111213141516171819202122232425262728293031323334
  1. using ComPDFKit.NativeMethod;
  2. using Compdfkit_Tools.Helper;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Configuration;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using static ComPDFKit.NativeMethod.CPDFSDKVerifier;
  11. namespace Measure
  12. {
  13. /// <summary>
  14. /// App.xaml 的交互逻辑
  15. /// </summary>
  16. public partial class App : Application
  17. {
  18. protected override void OnStartup(StartupEventArgs e)
  19. {
  20. base.OnStartup(e);
  21. LicenseVerify();
  22. }
  23. private static bool LicenseVerify()
  24. {
  25. if (!CPDFSDKVerifier.LoadNativeLibrary())
  26. return false;
  27. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(SDKLicenseHelper.ParseLicenseXML(), false);
  28. return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
  29. }
  30. }
  31. }