麻烦给个代码,另外要不要引用头文件捏!
------解决方案--------------------------------------------------------
DateTime::Now
------解决方案--------------------------------------------------------
DateTime dt = DateTime::Now;
labTimer->Text = dt.ToString(L"yyyy-MM-dd HH:mm:ss");
------解决方案--------------------------------------------------------
非托管的可以用
#include <windows.h>
// SetFileToCurrentTime - sets last write time to current system time
// Return value - TRUE if successful, FALSE otherwise
// hFile - must be a valid file handle
BOOL SetFileToCurrentTime(HANDLE hFile)
{
FILETIME ft;
SYSTEMTIME st;
BOOL f;
GetSystemTime(&st); // gets current time
SystemTimeToFileTime(&st, &ft); // converts to file time format
f = SetFileTime(hFile, // sets last-write time for file
(LPFILETIME) NULL, (LPFILETIME) NULL, &ft);
return f;
}