App.xaml.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 ContentEditorViewControl
  16. {
  17. public partial class App : Application
  18. {
  19. protected override void OnStartup(StartupEventArgs e)
  20. {
  21. string str = this.GetType().Assembly.Location;
  22. base.OnStartup(e);
  23. LicenseVerify();
  24. Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
  25. Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
  26. }
  27. private static bool LicenseVerify()
  28. {
  29. if (!LoadNativeLibrary())
  30. return false;
  31. LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify("license_key_windows.txt", true);
  32. return (verifyResult == LicenseErrorCode.E_LICENSE_SUCCESS);
  33. }
  34. }
  35. }