请问vc如何用一个函数同时创建多个文件夹,可以同时创建不存在的父文件夹
请问vc如何用一个函数同时创建多个文件夹,可以同时创建不存在的父文件夹
问题点数:10、回复次数:4Top
1 楼wangk(倒之)回复于 2006-06-01 14:47:44 得分 2
SHCreateDirectory
Header shlobj.h
Import library shell32.lib
Minimum operating systems Windows 2000
Top
2 楼ouyh12345(五岭散人)回复于 2006-06-01 14:48:48 得分 2
CreateDirectoryTop
3 楼ahcpx(天雪)回复于 2006-06-01 14:51:36 得分 4
BOOL Create(CString cFullPath)
{
cFullPath.Replace("/","\\");
if(cFullPath.Right(1)!="\\")
cFullPath+="\\";
int iPos = cFullPath.Find(_T("\\\\")) + 1;
if(iPos != 0)
{ //
iPos = cFullPath.Find(_T('\\'), iPos + 1);
iPos = cFullPath.Find(_T('\\'), iPos + 1);
}
else
{ //
iPos = cFullPath.Find(_T('\\'), iPos + 1);
}
while( -1 != (iPos = cFullPath.Find(_T('\\'), iPos + 1)) )
{
::CreateDirectory(cFullPath.Left(iPos), NULL);
}
return TRUE;
}Top
4 楼wangk(倒之)回复于 2006-06-01 14:58:06 得分 2
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/SHCreateDirectory.aspTop




