首页 > 其他 > 详细

判断路径是目录还是文件

时间:2015-01-21 01:08:01      阅读:348      评论:0      收藏:0      [点我收藏+]
//strPath为需要判断的路径

if ( GetFileAttributes(strPath) & FILE_ATTRIBUTE_DIRECTORY )
{
    MessageBox("Is a Directory");
}
else
{
    MessageBox("Is not a Directory");
}

 

还可以用以下函数

BOOL PathIsDirectory(          LPCTSTR pszPath
);
Verifies that a path is a valid directory。

 

判断路径是目录还是文件

原文:http://www.cnblogs.com/Lthis/p/4237763.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!