C++ 指定路径文件夹存在与否查询及文件夹创建
在MFC环境下
CString folder=L"H:\\h264视频"; //存文件夹路径 CFileFind finder; //在mfc中有这样一个类叫做CFileFind, if (finder.FindFile(folder))//如果返回值为1表示路径存在,为0则表示不存在 { MessageBox(L"文件夹存在!"); } else { MessageBox(L"文件夹不存在!"); CreateDirectory(folder,NULL);//创建文件夹 }