| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #pragma once
- #ifndef _TRYTO_SNREGISTER_HEAD
- #define _TRYTO_SNREGISTER_HEAD
- #include <afx.h>
- class CSNRegister:public CObject
- {
- enum{CREATE,OPEN};
- void ClearAll();
- char m_sztemp[1024];
- public:
- CSNRegister();
- ~CSNRegister();
- private:
- BOOL Load(const char *&pStrDirectroy);
- void Store(const char *&pStrDirectroy);
- virtual void Serialize(CArchive& ar);
- void encrypt(
- char *byCode,
- char *bySn,
- char *byUseTime,
- char *byPName,
- char *byStartTime,
- char *byEndTime,
- char *byLeftTime);
- void decrypt(
- char *byCode,
- char *bySn,
- char *byUseTime,
- char *byPName,
- char *byStartTime,
- char *byEndTime,
- char *byLeftTime);
- void ShowCihper(BYTE *rtext,long len);
- void HalfByteToByte(BYTE *rin,BYTE *rout, long len);
- int GetCheck(BOOL btype);
- void GetByteSum(DWORD &dwSum, CString &strSrc);
- public:
- BOOL itf_read_snfile(const char *szfile);
- BOOL itf_create_snfile(
- const char *szfile,
- char *byCode,
- char *bySn,
- char *byUseTime,
- char *byPName,
- char *byStartTime,
- char *byEndTime,
- char *byLeftTime);
- BOOL itf_modify_snfile(
- const char *szfile,
- char *byCode,
- char *bySn,
- char *byUseTime,
- char *byPName,
- char *byStartTime,
- char *byEndTime,
- char *byLeftTime);
- public:
- BOOL itf_IsCorrectSN(const char *szfile);
- void itf_SavebyLTime(const DWORD &dwLTime,const char *szPath);
- DWORD itf_returnLeftTime();
- char *itf_returnSnCode();
- char *itf_returnCheckCode();
- char *itf_encrypt(char *szSrc);
- char *itf_decrypt(char *szSrc);
- public:
- CString m_strStart; // 起始符; 7F;
- CString m_strCode; // 128位特征码,防伪,实码64位;
- CString m_strSn; // 48位加密SN码,实码18位;
- CString m_strUseTime; // 使用时间;
- CString m_strPName; // 项目名称;
- CString m_strStartTime; // 建成时间;
- CString m_strEndTime; // 完成时间;
- CString m_strLeftTime; // 剩余时间;
- CString m_strCheck; // 校验码;
- CString m_strEndof; // 终止符; 0D;
-
- };
- #endif
|