| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- /*************************************************************************
- 【文件名】 LicenseMgr.h
- 【功能模块和目的】 授权管理器类头文件
- 【开发者及日期】 郑石诺 2016/09/06
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- #pragma once
- /*************************************************************************
- 【类名】 CLicenseMgr
- 【功能】
- 【接口说明】 授权管理器类
- 【开发者及日期】 郑石诺 2016/09/06
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2016 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- class CLicenseMgr
- {
- SINGLETON_DECLARE(CLicenseMgr)
- private:
- typedef enum tagLicense_Key_Type
- {
- License_Key_CpuId = 0,
- License_Key_PhysicalValue = 1,
- License_Key_HardDiskId = 2,
- License_Key_TrunkNum = 3,
- License_Key_AgentNum = 4,
- License_Key_IvrFlowNum = 5,
- License_Key_VoipNum = 6,
- License_Key_FaxNum = 7,
- License_Key_EndTime = 8,
- License_Key_BeginTime = 9
- }License_Key_Type;
- public:
- CLicenseMgr(void);
- virtual ~CLicenseMgr(void);
- bool checkLicense(void);
- private:
- static void CALLBACK __vaildTimer(void);
- bool __readlicense(CString& License);
- CString __decode(CString LicCode);
- CString __getValue(CString License, License_Key_Type Key);
- bool __getCpuId(CString& CpuId);
- bool __getMac(CString& Mac);
- CTime __getTimeFromString(LPCTSTR TimeString);
- bool __checkTimeInReg(void);
- bool __checkCpuId(CString License);
- bool __checkMac(CString License);
- bool __checkTime(CString License);
- private:
- CString m_License;
- };
|