1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
char szcurrentDate[MAX_PATH] = "";
char szdate_time[MAX_PATH];
SYSTEMTIME st;
GetLocalTime (&st);
GetDateFormat(LOCALE_USER_DEFAULT,NULL,&st,"yyyy-M-d ",szcurrentDate,MAX_PATH); //current system date
//std::ostringstream mm;
//stringstream mm;
//mm << szcurrentDate;
MessageBoxA(NULL,szcurrentDate, "Attention", IDOK == IDCANCEL);
ifstream ifs(szFile);
string line;
while ( !ifs.eof() )
{
getline(ifs, line);
if((line.find("TESTING_GET_DATE:") != string::npos))
{
std::string str = line.substr(17,9); // substract TESTING_GET_DATE: 2014-3-16 to 2014-3-16
strcpy(szdate_time, str.c_str());
if (szcurrentDate == szdate_time)
{
MessageBoxA(NULL,"Same","Attention",MB_OK);
}
else
{
MessageBoxA(NULL,"blablabla","Attention",MB_OK);
}
|