函数原型:

CreateDirectory(
LPCTSTR lpPathName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);

简介:

CreateDirectory 是Win32API函数,用于创建文件夹。
     参数 lpPathName 表示路径
    参数 lpSecurityAttributes 表示安全属性

例子:

   //设置属性
SECURITY_ATTRIBUTES attribute;
attribute.nLength = sizeof(attribute);
attribute.lpSecurityDescriptor = NULL;
attribute.bInheritHandle = FALSE;
//创建
if(CreateDirectoryA(“d:\\hehe”,&attribute) == )
AfxMessageBox("false");

2.

检查指定的目录是否存在.
Verifies that a path is a valid directory.
 
BOOL PathIsDirectory(_In_ LPCTSTR pszPath);
 
param : pszPath 路径文本.
 
return :
若找到该目录返回 FILE_ATTRIBUTE_DIRECTORY
若未找到 返回FALSE.
 

CreateDirectory 创建文件夹 C\C++的更多相关文章

  1. 总结java创建文件夹的4种方法及其优缺点-JAVA IO基础总结第三篇

    本文是Java IO总结系列篇的第3篇,前篇的访问地址如下: 总结java中创建并写文件的5种方式-JAVA IO基础总结第一篇 总结java从文件中读取数据的6种方法-JAVA IO基础总结第二篇 ...

  2. C#创建文件夹

    string path = Server.MapPath("~/DefaultImg/newDir/63/");//获取文件路径 if (!Directory.Exists(pat ...

  3. asp.net 文件操作小例子(创建文件夹,读,写,删)

      静态生成要在虚拟目录下创建文件夹 来保存生成的页面 那么就要对文件进行操作 一.创建文件夹 using System.IO; string name = "aa"; strin ...

  4. C#创建文件夹、文件

    private void CheckCatcheDirectory()//创建文件夹      {          if (!Directory.Exists(xmlFilePath))//xmlF ...

  5. C# 创建文件时,文件夹不存在,如何自动创建文件夹

    c# 创建文件时怎么创建文件夹?strhtml=......StreamWriter sw=new StreamWriter("D:/test/1.aspx",false);sw. ...

  6. C# 在本地创建文件夹及子文件夹

    string dict = @"d:\估价报告\"; if (!Directory.Exists(dict)) { Directory.CreateDirectory(dict); ...

  7. MFC下对文件及文件夹的操作(复制、剪切、删除、创建文件夹,写文件)

    一.文件夹的创建 void CFileOperationDlg::OnButtonMakeFolder() { // TODO: Add your control notification handl ...

  8. System.IO在不存在的路径下创建文件夹和文件的测试

    本文测试System.IO命名空间下的类,在不存在的路径下创建文件夹和文件的效果: 首先测试创建文件夹: System.IO.Directory.CreateDirectory(@"C:\A ...

  9. C#创建文件夹和文件

    一.创建文件夹,例: if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } 二.创建文件,例: global::Syste ...

随机推荐

  1. Python性能鸡汤(转)

    英文原文:http://blog.monitis.com/index.php/2012/02/13/python-performance-tips-part-1/ 英文原文:http://blog.m ...

  2. python修饰器各种实用方法

    This page is meant to be a central repository of decorator code pieces, whether useful or not <wi ...

  3. Loadrunner之脚本的思考时间(固定/随机)设置、调试、保存、测试服务器监控等(六)

    一.思考时间的设置 1)设置固定思考时间: Action(){ // … your code lr_think_time(3); //固定设置此处思考时间3s // … more of your co ...

  4. android switch控件

    <Switch android:layout_width="wrap_content" android:layout_height="@dimen/minCellH ...

  5. 001-GPG入门教程

    对信息加密和解密.需要用到GnuPG软件(简称GPG),它是目前最流行.最好用的加密工具之一. 一.什么是GPG 要了解什么是GPG,就要先了解PGP. 1991年,程序员Phil Zimmerman ...

  6. Dokcerfile部署webpy,安装imagehash库并运行py脚本获取图片dhash值

    Dockerfile FROM lmurawsk/python2.7 RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple image ...

  7. eclipse向svn提交代码的时候忽略部分资源配置

    eclipse向svn提交代码的时候有 .settings, .project, .classpath, target等不需要上传,所以在eclipse中配置一下就不会显示了,方法如下图:

  8. R中apply等函数用法[转载]

    转自:https://www.cnblogs.com/nanhao/p/6674063.html 1.apply函数——对矩阵 功能是:Retruns a vector or array or lis ...

  9. [LeetCode] 258. Add Digits_Easy tag: Math

    Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. ...

  10. #C语言初学记录(位运算)

    位运算 Problem Description7-1 数组元素循环右移问题 一个数组A中存有N(>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥0)个位置,即将A中的数据由 ...