//确保目录存在,不存在则创建之
CString MakeSureDirExist( CString strRelativePath )
{
int index=0;
CString strFullPath("");
int nLen = GetFullPathName(strRelativePath.GetBuffer(),MAX_PATH,strFullPath.GetBuffer(MAX_PATH),NULL);
strFullPath.ReleaseBuffer();
while ((index=strFullPath.Find('\\',index))!=-1)
{
index++;
CString path=strFullPath.Mid(0,index);
CreateDirectory(path,NULL);
}
return strFullPath;
}
确认某个目录是否存在,如果不存在则创建
最新推荐文章于 2023-02-23 09:03:17 发布