我想检索文件的最后写入日期。我已经为它编写了这段代码,但它总是以“Year”之类的值返回我 52428
int LastErrorCode;
LPCSTR Path = "C:/Users/Username/Desktop/Picture.PNG";
WIN32_FIND_DATA Information;
if(!FindFirstFile(Path, &Information))
{
int LastErrorCode = GetLastError();
cout << "FIND FIRST FILE FAILED" << endl;
cout << LastErrorCode << endl;
}
SYSTEMTIME MyTime;
FILETIME MyFileTime = Information.ftLastWriteTime;
if(!FileTimeToSystemTime(&MyFileTime, &MyTime))
{
LastErrorCode = GetLastError();
cout << "FILE TIME TO SYSTEM TIME FAILED" << endl;
cout << LastErrorCode << endl;
}
cout << MyTime.wYear << endl;