00001
00002
00003
00004
00005
00006 #define TYPERUNS 100
00007 #define TYPEDAYS 200
00008 class CExpire
00009 {
00010 public:
00011 int GetDaysLeft();
00012 int GetRunsLeft();
00013 bool HasExpired();
00014
00015 CExpire(const char* ProgName,const char* KeyName, int Num, int ExpireType);
00016 virtual ~CExpire();
00017 private:
00018 bool CreateProtectFile();
00019 bool m_filefound;
00020 bool LocateFile();
00021 char m_systemfolder[MAX_PATH];
00022 char m_filename[MAX_PATH];
00023 bool DeObfuscate(char *str, int& num);
00024 bool Obfuscate(int num, char *str);
00025 bool GetRunCount(int& count);
00026 bool SetRunCount();
00027 bool SetRunCount(int count);
00028 bool GetDayCount(int& count);
00029 bool SetDayCount();
00030 bool CreateProgKey(const char* ProgName, const char* KeyName);
00031 int m_ExpireType;
00032 int m_count;
00033 HKEY m_hKey;
00034 bool m_first;
00035 };