if(finder.IsDirectory()   &&   !finder.IsDots())   //如果是目录  
{}
IsDirectory()判断是否目录
IsDots()) 判断是否为.或..在dos中说明每个目录下都有缺省的两个目录分别为"."和".."分别表示上一层目录和本层目录因此当我们遍历目录树下的文件时要过滤掉这两个缺省目录。
MSDN帮助解释:

virtual BOOL IsDots( ) const;

Return Value

Nonzero if the found file has the name "." or "..", which indicates that the found file is actually a diretory. Otherwise 0. 

 

相关文章:

  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-07-25
  • 2022-02-24
猜你喜欢
  • 2021-10-22
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
相关资源
相似解决方案