SerialNumberGenerator.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #pragma once
  2. #include <windows.h>
  3. #include <xstring.hpp>
  4. namespace nkg {
  5. enum class NavicatLanguage {
  6. English,
  7. SimplifiedChinese,
  8. TraditionalChinese,
  9. Japanese,
  10. Polish,
  11. Spanish,
  12. French,
  13. German,
  14. Korean,
  15. Russian,
  16. Portuguese
  17. };
  18. enum class NavicatProductType {
  19. DataModeler,
  20. Premium,
  21. MySQL,
  22. PostgreSQL,
  23. Oracle,
  24. SQLServer,
  25. SQLite,
  26. MariaDB,
  27. MongoDB,
  28. ReportViewer
  29. };
  30. class SerialNumberGenerator {
  31. private:
  32. BYTE _Data[10];
  33. std::xstring _SerialNumberShort;
  34. std::xstring _SerialNumberLong;
  35. public:
  36. SerialNumberGenerator() noexcept;
  37. void SetLanguageSignature(NavicatLanguage Language) noexcept;
  38. void SetLanguageSignature(BYTE LanguageSignature0, BYTE LanguageSignature1) noexcept;
  39. void SetProductSignature(NavicatProductType ProductType) noexcept;
  40. void SetProductSignature(BYTE ProductSignature) noexcept;
  41. void SetVersion(BYTE Version);
  42. void Generate();
  43. [[nodiscard]]
  44. const std::xstring& GetSerialNumberShort() const noexcept;
  45. [[nodiscard]]
  46. const std::xstring& GetSerialNumberLong() const noexcept;
  47. void ShowInConsole() const;
  48. };
  49. }