App.xaml.cs 962 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Reflection;
  2. using System.Windows;
  3. using System.Xml;
  4. using ComPDFKit.NativeMethod;
  5. using Compdfkit_Tools.Helper;
  6. namespace FormViewControl
  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. base.OnStartup(e);
  16. LicenseVerify();
  17. }
  18. private static bool LicenseVerify()
  19. {
  20. bool result = false;
  21. result = CPDFSDKVerifier.LoadNativeLibrary();
  22. if (!result)
  23. return false;
  24. SDKLicenseHelper sdkLicenseHelper = new SDKLicenseHelper();
  25. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(sdkLicenseHelper.key, sdkLicenseHelper.secret);
  26. if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS)
  27. return false;
  28. return result;
  29. }
  30. }
  31. }