
在MFC中如何读取文件的保存时间,急
1个回答
展开全部
void fun()
{
CFileFind finder;
CTime tempTime;
CString str;
BOOL bWorking = finder.FindFile("c:\\1.txt");
if (bWorking)
{
bWorking = finder.FindNextFile();
cout << (LPCTSTR) finder.GetFileName() << endl;
// 创建时间
if (finder.GetCreationTime(tempTime))
{
str = tempTime.Format(_T("%c"));
cout << (LPCTSTR)str << endl;
}
// 最后访问时间
if (finder.GetLastAccessTime(tempTime))
{
str = tempTime.Format(_T("%c"));
cout << (LPCTSTR)str << endl;
}
// 最后修改时间
if (finder.GetLastWriteTime(tempTime))
{
str = tempTime.Format(_T("%c"));
cout << (LPCTSTR)str << endl;
}
}
}
{
CFileFind finder;
CTime tempTime;
CString str;
BOOL bWorking = finder.FindFile("c:\\1.txt");
if (bWorking)
{
bWorking = finder.FindNextFile();
cout << (LPCTSTR) finder.GetFileName() << endl;
// 创建时间
if (finder.GetCreationTime(tempTime))
{
str = tempTime.Format(_T("%c"));
cout << (LPCTSTR)str << endl;
}
// 最后访问时间
if (finder.GetLastAccessTime(tempTime))
{
str = tempTime.Format(_T("%c"));
cout << (LPCTSTR)str << endl;
}
// 最后修改时间
if (finder.GetLastWriteTime(tempTime))
{
str = tempTime.Format(_T("%c"));
cout << (LPCTSTR)str << endl;
}
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询