效果

源码
#include
#include
int main(int argc, PCHAR argv[]){
//在程序当前目录创建 "当前目录" 目录
LPTSTR szDirPath = TEXT("当前目录");
if (!CreateDirectory(szDirPath, NULL)){
printf("创建目录 %s 错误\n", szDirPath);
return 1;
}
//在C盘创建 "C盘目录" 目录
szDirPath = TEXT("C:\\C盘目录");
if (!CreateDirectory(szDirPath, NULL)){
printf("创建C盘目录 %s 错误\n", szDirPath);
return 1;
}
printf("成功在当前目录和C盘创建了对应的目录\n");
getchar();
return 0;
}
网友评论