vc创建多级目录
时间:2011-06-15 来源:雲中鶴
void CreateAllDirectories(CString strDir)
{
//remove ending / if exists
if(strDir.Right(1)=="\\")
strDir=strDir.Left(strDir.GetLength()-1);
// base case . . .if directory exists
if(GetFileAttributes(strDir)!=-1)
return;
// recursive call, one less directory
int nFound = strDir.ReverseFind('\\');
CreateAllDirectories(strDir.Left(nFound));
// actual work
CreateDirectory(strDir,NULL);
} 相关阅读 更多 +
排行榜 更多 +










