expire.h

来自「程序运行时间限制的封装类」· C头文件 代码 · 共 36 行

H
36
字号
/*
Author : Nish
EMail : nishforever@vsnl.com
*/

#define TYPERUNS 100
#define TYPEDAYS 200
class CExpire  
{
public:
	UINT GetDaysLeft();
	UINT GetRunsLeft();
	bool HasExpired();

	CExpire(const char*  ProgName,const char* KeyName, UINT Num, UINT ExpireType);
	virtual ~CExpire();
private:
	bool CreateProtectFile();
	bool m_filefound;
	bool LocateFile();
	char m_systemfolder[MAX_PATH];
	char m_filename[MAX_PATH];
	bool DeObfuscate(char *str, UINT& num);
	bool Obfuscate(UINT num, char *str);	
	bool GetRunCount(UINT& count);
	bool SetRunCount();
	bool SetRunCount(UINT count);
	bool GetDayCount(UINT& count);
	bool SetDayCount();
	bool CreateProgKey(const char*  ProgName, const char* KeyName);
	UINT m_ExpireType;
	UINT m_count;
	HKEY m_hKey;
	bool m_first;
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?