http://bbs.csdn.net/topics/390830528
TRY
{
CFileStatus FileStatus;
CFile::GetStatus(_T(
"F:\\123"
), FileStatus);
CString cTime = FileStatus.m_ctime.Format(TEXT(
"%Y-%m-%d %H:%M:%S"
));
CString mTime = FileStatus.m_mtime.Format(TEXT(
"%Y-%m-%d %H:%M:%S"
));
CString aTime = FileStatus.m_atime.Format(TEXT(
"%Y-%m-%d %H:%M:%S"
));
if
(FileStatus.m_attribute&CFile::hidden)
{
::OutputDebugString(TEXT(
"隐藏文件\n"
));
}
if
(FileStatus.m_attribute&CFile::directory)
{
::OutputDebugString(TEXT(
"文件夹\n"
));
}
if
(FileStatus.m_attribute&CFile::archive)
{
::OutputDebugString(TEXT(
"归档\n"
));
}
if
(FileStatus.m_attribute&CFile::
system
)
{
::OutputDebugString(TEXT(
"系统\n"
));
}
if
(FileStatus.m_attribute&CFile::readOnly)
{
::OutputDebugString(TEXT(
"只读\n"
));
}
}CATCH(CFileException, e)
{
e->ReportError();
}END_CATCH