App.xaml.cs 878 B

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