App.xaml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. bool result = LoadNativeLibrary();
  26. if (!result)
  27. {
  28. return false;
  29. }
  30. SDKLicenseHelper sdkLicenseHelper = new SDKLicenseHelper();
  31. string TrialKey = "XvnZGEvx9IZlci4n0AIvhaOh98oIetIX+P8yOKgK3rdR+gp2wKYNdFB4cHnt+WIoUfimU0041gT1mRcKQ27D0wcTRk8URFuWJsjanD7GSHr2WbY8ukgPZVonIRUZC9qrwgPnP93UQbcu16GSvMyLsV6z4m4bhiQ+JcZ6jwkckDE=";
  32. string TrialSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYSXB8erGstkUyaynN7k8o9Bkm261z3QDQQd7GhWhZ9ncfsMf6ptexRA+BXdOITlphrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSnxfuQtxA3SCjGmJx+Rn/MrKDl1EzWv/F/0Gw7Q02pypAMFoEMtjKxkVmy+liLW9u9";
  33. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(sdkLicenseHelper.key, sdkLicenseHelper.secret);
  34. //LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(TrialKey, TrialSecret);
  35. if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
  36. {
  37. return false;
  38. }
  39. return result;
  40. }
  41. }
  42. }