mkdir
CreateDirectory好像都只能一次创建一层的。。

解决方案 »

  1.   

    KAO,除非你的目录名有一定的规则。
      

  2.   

    #include <io.h>
    #include <direct.h>
    #include <string>using namespace std;#ifdef _UNICODE
    #define string wstring
    #endifvoid ForceDirectory(const TCHAR* szPath)
    {
    if (_taccess(szPath, 0) != -1) return; string sPath = szPath; // 添加尾端斜杠
    if (sPath.substr(sPath.length() - 1, 1) != _T("\\"))
    sPath += _T("\\"); int nEnd = sPath.rfind(_T("\\"));
    int nPos = sPath.find(_T("\\"));

    if (sPath[nPos - 1] == _T(':'))
    nPos = sPath.find(_T("\\"), nPos + 1);
    while( nPos != string::npos && nPos <= nEnd )
    {
    string path = sPath.substr(0, nPos + 1);
    if(_taccess(path.c_str(), 0) == -1)
    _tmkdir(path.c_str()); nPos = sPath.find(_T("\\"), nPos + 1);
    }
    }
      

  3.   

    层层处理,从路径开始是一层一层的处理
    如果发现有一层的文件夹未create,则接着一层一层创建文件夹
      

  4.   

    In fact, you could only do that step by step!
      

  5.   

    用fileSystemObject对象中的FOLDER对象可以一次创建出
      

  6.   

    不会的八一定可以一下子创建的八,
    api就没有一个这样的东西??