mfc判断目录是否为空

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;
}
posted @ 2021-06-18 18:26  Hey,Coder!  阅读(248)  评论(0编辑  收藏  举报