当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 初学j2ee,请大家推荐几本好一点的书,多谢了! ......
 ·求:.net演讲报告资料    »显示摘要«
    摘要: 前一段时间经理要求各成员自学.net,上个星期就要求我下周做一个.net的学习报告 怎么讲呀?望各位能提供一些演讲资料,谢谢! 演讲内容现在未限。 ......


谁愿意帮我解决如下问题,我愿意500分赠送在线等

要求:在指定路径(例如:D:\123   )文件夹下面,删除所有0字节的文本文件

500分阿!!   这个大奖我来拿,呵呵  
   
  这个程序是可以删除特定目录下的所有零字节的文件的,目录设定的是D:\123,你可以改成其他的。  
  我的环境是WinXP   +   VC6,调试成功。  
   
  #include   <stdio.h>  
  #include   <windows.h>  
  #include   <direct.h>  
  #include   <io.h>  
   
  void   _del(   struct   _finddata_t   *file   )  
  {  
  if(   ::GetFileAttributes(file->name)   &   FILE_ATTRIBUTE_DIRECTORY   )   {  
  printf(   "[%s]   is   a   directory.   SKIP.\n",   file->name   );  
  }  
  else   if(file->size   >   0)   {  
  printf(   "[%s]   is   a   file,   size   =   %d.   SKIP.\n",   file->name,   file->size   );  
  }  
  else   if(file->size   ==   0)   {  
  printf(   "[%s]   is   a   file,   size   =   0.   DELETE.\n",   file->name   );  
  ::DeleteFile(   file->name   );  
  }  
  }  
   
   
  int   main()  
  {  
  long                               handle;  
  struct   _finddata_t   file;  
   
  _chdir(   "d:\\123\\"   );  
  handle   =   _findfirst(   "*",   &file   );  
  if(   handle   ==   -1   )   return   0;  
   
  _del(   &file   );  
   
  while(   !_findnext(   handle,   &file   )   )   {  
  _del(   &file   );  
  }  
   
   
  return   0;  
  }


 ·波音,客机里滴战斗机    »显示摘要«
    摘要: 热烈庆祝911四周年!! 向真主的勇士们致敬~~~ 前十名有分 ......
» 本期热门文章:
· 热门栏目:
» 相关精选文章
» 其它相关:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE