|
[code]void CFindDwgFileDlg::Browser(CString strDir)
{
CFileFind ff;
CString strPath = strDir;
if (strPath.Right(1) != "\\")
{
strPath += "\\";
}
strPath += "*.*";
BOOL res = ff.FindFile(strPath);
while (res)
{
res = ff.FindNextFile();
if (ff.IsDirectory() && !ff.IsDots()) // 如果是一个子目录,进行递归查找
{
Browser(ff.GetFilePath());
}
else
{
if (!ff.IsDirectory() && !ff.IsDots())
{
CString strFileName = ff.GetFileName();
if (strFileName.Right(3) == "dwg")
{
m_lstFiles.AddString(ff.GetFileName());
}
}
}
}
ff.Close();
}[/code] |
|