App.xaml.cs 1.1 KB

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