函数原型:
CreateDirectory(
LPCTSTR lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
简介:
CreateDirectory 是Win32API函数,用于创建文件夹。
参数 lpPathName 表示路径
参数 lpSecurityAttributes 表示安全属性
例子:
1 //设置属性 2 SECURITY_ATTRIBUTES attribute; 3 attribute.nLength = sizeof(attribute); 4 attribute.lpSecurityDescriptor = NULL; 5 attribute.bInheritHandle = FALSE; 6 //创建 7 if(CreateDirectoryA(“d:\hehe”,&attribute) == 0) 8 AfxMessageBox("false");
2.
检查指定的目录是否存在.
Verifies that a path is a valid directory.
BOOL PathIsDirectory(_In_ LPCTSTR pszPath);
param : pszPath 路径文本.
return :
若找到该目录返回 FILE_ATTRIBUTE_DIRECTORY
若未找到 返回FALSE.