曲径通幽论坛

 找回密码
 立即注册
搜索
查看: 5058|回复: 0
打印 上一主题 下一主题

windows 下用 C 对文件夹操作一例子

[复制链接]

4917

主题

5879

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34382
跳转到指定楼层
楼主
发表于 2008-11-16 22:48:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include  <direct.h> 
  #include  <stdlib.h> 
  #include  <stdio.h> 
   
  void  main(  void  ) 
  { 
        if(  _mkdir(  "\\testtmp"  )  ==  0  ) 
        { 
              printf(  "Directory  '\\testtmp'  was  successfully  created\n"  ); 
              system(  "dir  \\testtmp"  ); 
              if(  _rmdir(  "\\testtmp"  )  ==  0  ) 
                  printf(  "Directory  '\\testtmp'  was  successfully  removed\n"    ); 
              else 
                    printf(  "Problem  removing  directory  '\\testtmp'\n"  ); 
        } 
        else 
              printf(  "Problem  creating  directory  '\\testtmp'\n"  ); 
  }
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )

GMT+8, 2024-5-13 11:02 , Processed in 0.077289 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表