学习API之目录操作一 创建目录

#include <windows.h>
#include <stdio.h>

int main()
{
LPSTR szDirPath = "测试";
if (!CreateDirectory(szDirPath,//路径或目录名
NULL))
{
printf("创建目录 %s 错误。\n", szDirPath);
return 1;
}
printf("创建成功\n");
return 0;
}

 

创建目录的函数

  CreateDirectory(

  LPCTSTR lpPathName,              //所要创建的目录名或路径

  LPSECURITY_ATTRIBUTES lpSecurityAttributes //可设为NULL,文件属性

);

 

posted @ 2016-05-19 11:05  mousemin  阅读(211)  评论(0编辑  收藏  举报