caa创建文件加夹

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、循环创建多级目录

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章