1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
SYSTEMTIME Time;
HANDLE File = CreateFile(("CardData/Prices/"+TargetCard.Name+".data").c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
HANDLE BlankFile = CreateFile("CardData/Prices/blank.data", GENERIC_READ, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
GetLocalTime(&Time);
FILETIME CreationTimeData;
FILETIME CreationTimeBlank;
GetFileTime(BlankFile, &CreationTimeBlank, NULL, NULL);
GetFileTime(File, &CreationTimeData, NULL, NULL);
ULONGLONG DataDays;
ULONGLONG BlankDays;
BlankDays = (((ULONGLONG) CreationTimeBlank.dwHighDateTime) << 32) + CreationTimeBlank.dwLowDateTime;
BlankDays += _DAY;
DataDays = (((ULONGLONG) CreationTimeData.dwHighDateTime) << 32) + CreationTimeData.dwLowDateTime;
DataDays += _DAY;
if((BlankDays-DataDays) > 0)//if date is greater than a day update it
{
Update = true;
remove(("CardData/Prices/"+TargetCard.Name+".data").c_str());
}
| |