如何获得文件最后修改时间

happyness44 2006-08-09 01:53:00
应用程序如何获得其对应exe文件最后修改时间
...全文
371 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
happyness44 2006-08-09
  • 打赏
  • 举报
回复
GetModuleFileName(NULL, buffer, sizeof(buffer))只能获得当前工程所在路径
不是exe的路径
goodboyws 2006-08-09
  • 打赏
  • 举报
回复
GetModuleFileName
happyness44 2006-08-09
  • 打赏
  • 举报
回复
BOOL bWorking = finder.FindFile(_T("C:\\a.exe"));
我不需要定的路径
如何动态获得产生的exe文档的路径
goodboyws 2006-08-09
  • 打赏
  • 举报
回复
CFileFind finder;
BOOL bWorking = finder.FindFile(_T("C:\\a.exe"));
if(bWorking)
{
finder.FindNextFile();
if (finder.GetLastWriteTime(tempTime))
{
str = tempTime.Format(_T("%c"));
_tprintf_s(_T("%s\n"), (LPCTSTR) str);
}
}

mynamelj 2006-08-09
  • 打赏
  • 举报
回复
看看这个结构
typedef struct _WIN32_FILE_ATTRIBUTE_DATA { DWORD dwFileAttributes; FILETIME ftCreationTime; FILETIME ftLastAccessTime; FILETIME ftLastWriteTime; DWORD nFileSizeHigh; DWORD nFileSizeLow;
} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
happyness44 2006-08-09
  • 打赏
  • 举报
回复
BOOL GetFileAttributesEx(
LPCTSTR lpFileName, // pointer to string that specifies a
// file or directory
GET_FILEEX_INFO_LEVELS fInfoLevelId,
// value that specifies the type of
// attribute information to obtain
LPVOID lpFileInformation // pointer to buffer to receive
// attribute information
);
那这些变量怎么设置
谁举个例?
lixiaosan 2006-08-09
  • 打赏
  • 举报
回复
http://blog.csdn.net/lixiaosan/archive/2006/04/07/654219.aspx

GetFileAttributesEx() 也行

cleverwyq 2006-08-09
  • 打赏
  • 举报
回复
LS正解
ALazyworm 2006-08-09
  • 打赏
  • 举报
回复
GetFileAttributesEx()

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧