#include
#include
using namespace std;
void func(LPTSTR fileName)
{
char sz[MAX_PATH];
lstrcpy(sz,fileName);
WIN32_FIND_DATA wfd;
HANDLE hFind;
TCHAR szF[MAX_PATH];
lstrcpy(szF,sz);
lstrcat(sz,"\\");
lstrcat(sz,"*.*");
hFind = FindFirstFile(sz,&wfd);
if(hFind == INVALID_HANDLE_VALUE)
return;
do
{
if(wfd.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
{
if(wfd.cFileName[0] == '.')
continue;
TCHAR szFn[MAX_PATH];
lstrcpy(szFn, szF);
lstrcat(szFn,"\\");
lstrcat(szFn,wfd.cFileName);
cout<
func(szFn);
}
}while( FindNextFile(hFind,&wfd) );
}
void main()
{
TCHAR* sR[4] = {"C:","D:","E:","F:"};
for(int i=0; i<4; i++)
func( sR[i] );
cin.get();
}