When i was testing the following code,i found that "data.cFileName" in "FtpFindFirstFile" was "." on some ftp,and on others,it was an actural file name.In the second case,"InternetFindNextFile" began with the second file.I just want to know why does this happen?Thanks!
if(hConnect){
cout<<"begin transfer……"<<endl;
find=::FtpFindFirstFile(hConnect,ftpDir,&data,INTERNET_FLAG_RELOAD,0);
cout<<"begin?-->"<<data.cFileName<<endl;
while(::InternetFindNextFile(find,&data)){
CString tempFtp=ftpDir;
CString tempLocal=localDir;
cout<<"file:"<<data.cFileName<<endl;
//dirArray.SetSize(10);
/*
if(data.dwFileAttributes==FILE_ATTRIBUTE_DIRECTORY){
cout<<"filename:"<<data.cFileName<<";"<<endl;
if(CString(data.cFileName).Find("..")<0){
cout<<"folder:"<<data.cFileName<<";"<<endl;
}
}else{
//this->checkMakePath(tempLocal);
tempFtp.Append(data.cFileName);
tempLocal.Append(data.cFileName);
cout<<"file:"<<tempLocal<<endl;
//::FtpGetFile(hConnect,tempFtp,tempLocal,false,FILE_ATTRIBUTE_NORMAL,FTP_TRANSFER_TYPE_BINARY,0);
}*/
}
}