我想檢查文件夾是否大於30天,並有下面的代碼如何comapre 2個FILETIME變量,看是否有文件是超過30天
static bool ExpiredDirectory(CComBSTR directory)
{
WIN32_FILE_ATTRIBUTE_DATA fileAttrData = {0};
GetFileAttributesEx(directory, GetFileExInfoStandard, &fileAttrData);
FILETIME ftCreatedDate = fileAttrData.ftCreationTime;
FILETIME now;
SYSTEMTIME nowst;
ULARGE_INTEGER t1, t2;
GetSystemTime(&nowst);
SystemTimeToFileTime(&nowst, &now);
---compare code goes here
}
我想比較上面的變量以查看ftCreatedDate是否大於30天
退房的CompareFileTime功能。 – 2013-05-02 14:14:46
謝謝,但比較文件時間只能比較和說哪兩個是最大的。我想檢查比例,例如它是否大於30天 – John 2013-05-02 14:28:28
是真的,但標題沒有提到30天的位,所以其他具有相同問題的人不會知道這個問題實際上與他們的相同。 – 2013-05-02 14:43:14