CreateDirectory:建立文件夹安全
CreateDirectory 函数的定义形式为:函数
BOOL CreateDirectory(LPCTSTR lpPathName,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
第一个参数:lpPathName: 文件夹名称 ;第二个参数:lpSecurityAttributes: 安全属性 ,通常为空code
返回值:正确建立返回1.建立失败返回0it
注:只能建立一层文件夹,需建立多层文件夹,需调用屡次class
具体用法如例:文件
但愿建立:d:\\TEST\\temp, 则:CString str = “d:\\TEST”; if(!CreateDirectory(str, NULL)) //建立失败 str = str + “\\temp”; if(!CreateDirectory(str, NULL)) //建立失败