//C语言修改文件时间
#include <stdio.h>
#include <process.h>
#include <fcntl.h>
#include <io.h>
FILE *fp;
fp = fopen(strBinPath, "w");
struct ftime filet;
filet.ft_year = 2004;
filet.ft_month = 8;
filet.ft_day = 17;
filet.ft_hour = 20;
filet.ft_min = 0;
filet.ft_tsec = 1;
setftime(fileno(fp), &filet);
------------------------------------------------------------------------------------------------
//C++ 修改文件时间
#include <windows.h>
#include <stdlib.h>
HANDLE hFile;
hFile = CreateFile (strBinPath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL, NULL);
SYSTEMTIME st;
memset(&st, 0, sizeof(st));
st.wYear = 2004;
st.wMonth = 8;
st.wDay = 17;
st.wHour = 20;
st.wMinute = 0;
FILETIME ft,LocalFileTime;
SystemTimeToFileTime(&st, &ft);
LocalFileTimeToFileTime(&ft,&LocalFileTime);
SetFileTime(hFile, &LocalFileTime, (LPFILETIME) NULL, &LocalFileTime);