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. 

 

相关文章: