C++ |
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
32
| #include <Windows.h>
#include <iostream>
#include <time.h>
using namespace std;
int main(int argc, char* argv[])
{
WIN32_FIND_DATA wf;
HANDLE FF;
FILETIME gettime;
SYSTEMTIME systime,yourfiletime;
GetLocalTime(&systime);
char dir[] = "D:/tasm//*.LST";
FF = FindFirstFile(dir,&wf);
gettime = wf.ftLastWriteTime;
FileTimeToSystemTime(&gettime,&yourfiletime);
cout << "system millisec:" <<systime.wMilliseconds << " File millisec: " << localsystemtime.wMilliseconds << endl;
if (FF == INVALID_HANDLE_VALUE)
{
cout << "FindFirstFile failed: " << GetLastError() << "\n";
}
else
{
cout << "The first file found is:" << wf.cFileName << "\n";
}
system("pause");
} |
|
Разберешься ? сравнивай systemtime и yourfiletime.
Они являются структурами. Внутри - год\месяц\день\etc