函数原型:

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. an upstream response is buffered to a temporary file

    an upstream response is buffered to a temporary file

  2. GET、POST编码问题

    GET请求.POST经常会出现中文乱码的问题,最好约定前后端的编码,一般为UTF-8.但是这里面也是有坑的. 后端设置编码为UTF-8的推荐方式: SpringMVC配置过滤器: <filter ...

  3. iOS中textbox文本框清除圆角

    在iOS.Mac safari中,所有的textbox, select, checkbox都会被强制美化为圆角.但在特殊情况下需要清除圆角时发现iOS中使用以下传统的css无效: border-rad ...

  4. [LeetCode] 394. Decode String_Medium tag: stack 666

    Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where ...

  5. [LeetCode] 680. Valid Palindrome II_Easy tag: Two Pointers

    Given a non-empty string s, you may delete at most one character. Judge whether you can make it a pa ...

  6. 7.12 Models -- Frequently Asked Questions

    一.Should I use a query or a filter to seach records?我应该使用一个查询或者过滤器来搜索记录吗? 这取决于你想要搜索多少reocrds并且它们是否被加 ...

  7. OBV_X3

    {OBV_X3[背景]考虑到OBV_X03在情况1的时候,采用的是寻找波段线的同价K线,但是由于此种情况下必须使用CONST(C)或通过输入参数CONSTCC设定固定值,无法当前K线的CLOSE同时变 ...

  8. C# 多线程,new ThreadStart(方法)中的方法如果有参数,该怎么写

    using System; using System.Threading; public class Work { public static void Main() { // Start a thr ...

  9. SVA描述(一)

    SystemVerilog Assertion(SVA):是一种描述性的语言,可以很容易的描述时序相关的情况,所以主要用在协议检查和协议覆盖.SVA在systemverilog仿真器中的 调度区间在R ...

  10. EntityFramework包含作用

    System.Data.Entity.Infrastructure.DbQuery的引用需要加入上面那个包