1、創建一級目錄
CATUnicodeString strFolderPath ="D:\\ImageShot";
//如果不存在創建文件夾
CString folderPath = strFolderPath.ConvertToChar();
if (!PathIsDirectory(folderPath))
{
bool flag = ::CreateDirectory(folderPath, 0);
if (flag==0)
{
cout<<"創建ImageShot文件夾失敗"<<endl;
::MessageBox(NULL,CString("創建ImageShot文件夾失敗"),_T("提示"),MB_OK|MB_ICONWARNING);
}
}
2、循環創建多級目錄