if ( !CreateDirectory(filePath, NULL) ) { AfxMessageBox("不能创建目录"); return; } 就可以创建目录了。filePath就是目录路径
CreateDirectory The CreateDirectory function creates a new directory. If the underlying file system supports security on files and directories, the function applies a specified security descriptor to the new directory. To specify a template directory, use the CreateDirectoryEx function.BOOL CreateDirectory( LPCTSTR lpPathName, // directory name LPSECURITY_ATTRIBUTES lpSecurityAttributes // SD );
{
AfxMessageBox("不能创建目录");
return;
}
就可以创建目录了。filePath就是目录路径
The CreateDirectory function creates a new directory. If the underlying file system supports security on files and directories, the function applies a specified security descriptor to the new directory. To specify a template directory, use the CreateDirectoryEx function.BOOL CreateDirectory(
LPCTSTR lpPathName, // directory name
LPSECURITY_ATTRIBUTES lpSecurityAttributes // SD
);