App.xaml.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.Reflection;
  9. using System.Threading.Tasks;
  10. using System.Windows;
  11. using System.Xml;
  12. using static ComPDFKit.NativeMethod.CPDFSDKVerifier;
  13. namespace ContentEditorViewControl
  14. {
  15. public partial class App : Application
  16. {
  17. protected override void OnStartup(StartupEventArgs e)
  18. {
  19. string str = this.GetType().Assembly.Location;
  20. base.OnStartup(e);
  21. LicenseVerify();
  22. }
  23. private static bool LicenseVerify()
  24. {
  25. bool result = LoadNativeLibrary();
  26. if (!result)
  27. return false;
  28. SDKLicenseHelper sdkLicenseHelper = new SDKLicenseHelper();
  29. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(sdkLicenseHelper.key, sdkLicenseHelper.secret);
  30. if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
  31. return false;
  32. return result;
  33. }
  34. }
  35. }