mfc判断目录是否为空

时间:2021-06-19 18:41:36   收藏:0   阅读:0
BOOL IsFolderEmpty(string path)
{
	string str = path + "\\*.*";
	CFileFind ff;
	BOOL bFound;
	bFound = ff.FindFile(str.c_str());
	while (bFound)
	{
		bFound = ff.FindNextFile();
		if (!ff.IsDots())
		{
			return FALSE;
		}
	}
	ff.Close();

	return TRUE;
}
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!