App.xaml.cs 796 B

123456789101112131415161718192021222324252627282930
  1. using System.Reflection;
  2. using System.Windows;
  3. using System.Xml;
  4. using ComPDFKit.NativeMethod;
  5. using Compdfkit_Tools.Helper;
  6. using static ComPDFKit.NativeMethod.CPDFSDKVerifier;
  7. namespace FormViewControl
  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. base.OnStartup(e);
  17. LicenseVerify();
  18. }
  19. private static bool LicenseVerify()
  20. {
  21. if (!LoadNativeLibrary())
  22. return false;
  23. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify("license_key_windows.txt", true);
  24. return (verifyResult != LicenseErrorCode.E_LICENSE_SUCCESS);
  25. }
  26. }
  27. }