创建多路径文件夹

BOOL CreateMultiDirs(CString xFilePath)
{
    int xFlag=xFilePath.Find(_T("\"));
    CString s;
    for(int i=0;i<256;i++)
    {
        xFlag=xFilePath.Find(_T("\"),xFlag+1);
        if(xFlag>3)
        {
            s=xFilePath.Left(xFlag);
            if (!PathFileExists(xFilePath))
            {
                CreateDirectory(s,0);
            }    
        }
        if(xFlag<0)
            return TRUE;
    }
    return FALSE;
}
原文地址:https://www.cnblogs.com/judes/p/10836973.html