App.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.Globalization;
  8. using System.Linq;
  9. using System.Reflection;
  10. using System.Threading;
  11. using System.Threading.Tasks;
  12. using System.Windows;
  13. using System.Xml;
  14. using static ComPDFKit.NativeMethod.CPDFSDKVerifier;
  15. namespace DocsEditControl
  16. {
  17. /// <summary>
  18. /// Interaction logic for App.xaml
  19. /// </summary>
  20. public partial class App : Application
  21. {
  22. protected override void OnStartup(StartupEventArgs e)
  23. {
  24. string str = this.GetType().Assembly.Location;
  25. base.OnStartup(e);
  26. LicenseVerify();
  27. Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
  28. Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
  29. }
  30. private static bool LicenseVerify()
  31. {
  32. if (!LoadNativeLibrary())
  33. return false;
  34. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify("license_key_windows.txt", true);
  35. return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
  36. }
  37. }
  38. }