VC中如何创建文件夹,并在文件夹中生成名为tmp.txt的文件?

解决方案 »

  1.   

    CreateFile
    CFile 操作就行
      

  2.   

    _SECURITY_ATTRIBUTES ss={0};
    ss.nLength=sizeof(_SECURITY_ATTRIBUTES);
    ss.bInheritHandle=TRUE;
    ss.lpSecurityDescriptor=NULL;
    ::CreateDirectory("d:\\testtset",&ss);
                   FILE* fp=fopen("d:\\testtset\\tmp.txt","wt");
    if(fp)
    fclose(fp);
      

  3.   

    1. 能详细讲解一下这段程序的意思吗?
    _SECURITY_ATTRIBUTESbInheritHandlelpSecurityDescriptorFILE*   fp=fopen( "d:\\testtset\\tmp.txt ", "wt "); 2. 我试了很好用,谢谢!
      

  4.   

    api函数CreateDirectory
    mfc:CFile.Open(CFile::modeCreate)