1 // 5nt.cpp : Defines the entry point for the console application. 2 // 3 4 #include "stdafx.h" 5 #include "stdio.h" 6 #include "windows.h" 7 8 int main(int argc, char* argv[]) 9 { 10 char szFileName[]="C:\\Program Files\\*.*"; 11 WIN32_FIND_DATA findDate; 12 HANDLE hFindFile; 13 hFindFile = ::FindFirstFile(szFileName,&findDate); 14 if (hFindFile!=INVALID_HANDLE_VALUE) 15 { 16 do 17 { 18 if (findDate.cFileName[0]=='.') 19 { 20 continue; 21 } 22 if (findDate.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 23 { 24 printf("%s\n",findDate.cFileName); 25 } 26 } while (::FindNextFile(hFindFile,&findDate)); 27 ::FindClose(hFindFile); 28 } 29 return 0; 30 }
。。