App.xaml.cs 861 B

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