MiddleWares_YiHe 郑州颐和医院随访系统中间件

LicenseMgr.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*************************************************************************
  2. 【文件名】 LicenseMgr.h
  3. 【功能模块和目的】 授权管理器类头文件
  4. 【开发者及日期】 郑石诺 2016/09/06
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. /*************************************************************************
  11. 【类名】 CLicenseMgr
  12. 【功能】
  13. 【接口说明】 授权管理器类
  14. 【开发者及日期】 郑石诺 2016/09/06
  15. 【版本】 V1.0.0
  16. 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
  17. 【更改记录】
  18. *************************************************************************/
  19. class CLicenseMgr
  20. {
  21. SINGLETON_DECLARE(CLicenseMgr)
  22. private:
  23. typedef enum tagLicense_Key_Type
  24. {
  25. License_Key_CpuId = 0,
  26. License_Key_PhysicalValue = 1,
  27. License_Key_HardDiskId = 2,
  28. License_Key_TrunkNum = 3,
  29. License_Key_AgentNum = 4,
  30. License_Key_IvrFlowNum = 5,
  31. License_Key_VoipNum = 6,
  32. License_Key_FaxNum = 7,
  33. License_Key_EndTime = 8,
  34. License_Key_BeginTime = 9
  35. }License_Key_Type;
  36. public:
  37. CLicenseMgr(void);
  38. virtual ~CLicenseMgr(void);
  39. bool checkLicense(void);
  40. private:
  41. static void CALLBACK __vaildTimer(void);
  42. bool __readlicense(CString& License);
  43. CString __decode(CString LicCode);
  44. CString __getValue(CString License, License_Key_Type Key);
  45. bool __getCpuId(CString& CpuId);
  46. bool __getMac(CString& Mac);
  47. CTime __getTimeFromString(LPCTSTR TimeString);
  48. bool __checkTimeInReg(void);
  49. bool __checkCpuId(CString License);
  50. bool __checkMac(CString License);
  51. bool __checkTime(CString License);
  52. private:
  53. CString m_License;
  54. };