那位高手能帮忙看一下,那个地方不对.为什么只能显示文件夹名,不能显示文件夹下的文件名呢? CString string;//存储ftp的目录
    
m_pInetSession=new CInternetSession (AfxGetAppName(),1,PRE_CONFIG_INTERNET_ACCESS);
            UpdateData(TRUE);
        try 
        {
        m_pFtpConnection=m_pInetSession->GetFtpConnection            ("127.0.0.1","anonymous","[email protected]");//连接ftp        if(m_pFtpConnection != NULL)//连接成功                                            {
                        
        m_pFtpConnection->GetCurrentDirectory(string);//得到ftp目录
        AddFile( string, NULL );
            
        }
  
    }
 catch (CInternetException * pEx)
    {
        
        UpdateData(false);
        TCHAR szError[1024];
  if ( pEx->GetErrorMessage(szError,1024)) 
    {
    
        UpdateData(false);
    }
  else 
        AfxMessageBox("There was an exception");
        pEx->Delete();
        m_pFtpConnection=NULL;
 }//递归遍历ftp上的文件和文件夹
void CFileTreeDlg::AddFile(CString StrPath, HTREEITEM faItem )
//StrPath为传递过来的目录层次,本次函数调用中搜索的文件都是它的下一层的。
//faItem为传递过来的Tree节点,本次函数调用中添加的Tree节点都是它的子节点。
{
    CFtpFileFind OneFile(m_pFtpConnection);
    CString FName, DirName;
    BOOL BeWorking; 
    HTREEITEM NewItem;    
    int n=0;
    
    DirName= StrPath+"\\*.*";
    BeWorking = OneFile.FindFile( DirName );
    while ( BeWorking )     
    {          
      BeWorking = OneFile.FindNextFile();    
      if ( OneFile.IsDirectory() && !OneFile.IsDots() ) //如果查找的结果是目录,但不是".."或"."
       {    
           DirName = OneFile.GetFilePath();//向Tree1中添加目录;
                FName = OneFile.GetFileName(); 
           NewItem = m_Tree.InsertItem( FName, faItem );
           //NewItem取得节点,其目的是为了下一层中添加节点方便,递归时把它传过去。
          AddFile(DirName, NewItem);//递归调用
      }
        
        
    if ( !OneFile.IsDirectory() && !OneFile.IsDots() ) //如果查找结果是文件
        {
          FName = OneFile.GetFileName();//向Tree1中添加文件
          m_Tree.InsertItem( FName, faItem );
        }        
    }
    
    OneFile.Close();//关闭CFileFild实例                        
}    程序运行编译运行没有错误,但是只能显示文件夹的名,没有文件夹下文件的名,也没有生成树型结构.请教高手指点,谢谢.