App.xaml.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using ComPDFKit.NativeMethod;
  2. using Compdfkit_Tools.Helper;
  3. using System.Reflection;
  4. using System.Windows;
  5. using System.Xml;
  6. namespace AnnotationViewControl
  7. {
  8. /// <summary>
  9. /// Interaction logic for App.xaml
  10. /// </summary>
  11. public partial class App: Application
  12. {
  13. protected override void OnStartup(StartupEventArgs e)
  14. {
  15. string str = this.GetType().Assembly.Location;
  16. base.OnStartup(e);
  17. LicenseVerify();
  18. }
  19. private static bool LicenseVerify()
  20. {
  21. bool result = false;
  22. result = CPDFSDKVerifier.LoadNativeLibrary();
  23. if (!result)
  24. return false;
  25. SDKLicenseHelper sdkLicenseHelper = new SDKLicenseHelper();
  26. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(sdkLicenseHelper.key, sdkLicenseHelper.secret);
  27. if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
  28. return false;
  29. return result;
  30. }
  31. }
  32. }