App.xaml.cs 1002 B

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