给作弊器加上“试用期限” 功能
// ================================================================================
int daysInMonth( int curMonth ) //一 三 五 七 八 十 腊 (为 31 天)
{
if ( curMonth == 1 ||
curMonth == 3 ||
curMonth == 5 ||
curMonth == 7 ||
curMonth == 8 ||
curMonth == 10 ||
curMonth == 12)
return 31;
else if ( !( curMonth == 2 ) )
return 30;
else
return 27;
}
// ================================================================================
int checkTrialExpired( )
{
int expTime = 30;
int startDay = 1;
int startMonth = 3;
int startYear = 2006;
SYSTEMTIME sysTime;
GetLocalTime(&sysTime);
int daysLeftInMonth = daysInMonth( startMonth ) - startDay;
int daysLeftInNextMonth = expTime - daysLeftInMonth;
int daysTotalLeft;
if ( sysTime.wMonth != startMonth )
daysTotalLeft = expTime - ( sysTime.wDay - startDay + daysInMonth( startMonth ) );
else
daysTotalLeft = expTime - ( sysTime.wDay - startDay );
if ( sysTime.wYear == startYear )
{
if ( sysTime.wDay > ( daysLeftInNextMonth + startDay ) )
return 0;
else
return daysTotalLeft;
}
else
return daysTotalLeft;
}
---------------------------------------------------------------------