您的位置:首页 > 其它

指定目录下查找指定目录(文件)

2010-09-13 14:31 190 查看
bool FindDir(CString DirPath, CString DirName)
{
 if(DirPath.GetLength()<=0  || DirName.GetLength()<=0)
  return false;
 
 CString strDirName;  
    DirPath+= "//*.*";
    CFileFind finder;
 
    BOOL bFind = finder.FindFile(DirPath);
 
    while (bFind)
    {
        bFind = finder.FindNextFile();
        if (!finder.IsDots())
        {
   
   if (finder.IsDirectory())
   {
    strDirName =finder.GetFileName();
    if(strDirName==DirName)
    {
     finder.Close(); 
     return true;
    }
   }
        }
    }
    finder.Close(); 
    return false;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: