// mID.cpp : ???? DLL Ӧ?ó????ĵ????????? // #ifdef _MSC_VER #include "checkID.h" #else #include #include #endif //#include "checkID.h" #include "mID.h" #include #ifdef _MSC_VER void getMIDKeyfile() { getid();//???ɻ????룬?????????ڵ?ǰĿ¼?µġ?key.nlpr?????? } //-1ʧ?? 1?ɹ? int checkMID(unsigned short buf[8]) { //???????к? if(checkid2(buf) != 0) { printf("Software license is incorrect! Please contact software developers.\n"); return -1; } else { printf("Software license has been detected.\n"); return 1; } } //????ID 1???ɹ? -1??ʧ?? int checkMIDbyKeyfile(const char * keyname) { Key key; FILE* fp = NULL; fp = fopen(keyname, "rb"); if (!fp) { printf("Software license hasn't been detected! Please contact software developers.\n"); return -1; } fread(&key,sizeof(struct Key), 1, fp); fclose(fp); return checkMID(key.id); } //??keyfileתΪ?????? void convertMID(const char * keyname) { Key key; FILE* fp = NULL; fp = fopen(keyname, "rb"); if (!fp) { printf("Software license hasn't been detected! Please contact software developers.\n"); return; } fread(&key,sizeof(struct Key), 1, fp); fclose(fp); fstream fout; fout.open("key.txt", ios::app); for (int i = 0; i < 8; i++) { fout<tm_year + 1900; nMonth = info->tm_mon + 1; nDay = info->tm_mday; if(nYear == 2019 && nMonth < 7) return 1; printf("Software license is out of time! Please contact software developers.\n"); //exit(0); return -1; }