Advertisement
Guest User

Untitled

a guest
Jul 12th, 2012
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. class Config
  7. {
  8. public:
  9.     void AllFiles()
  10.         {
  11.             WIN32_FIND_DATA win;
  12.             HANDLE han;
  13.             char *buff=new char[255];
  14.  
  15.             han= FindFirstFile(TEXT("C:\\new\\*.*"),&win);
  16.             if(han!=INVALID_HANDLE_VALUE)
  17.             {
  18.                 strcpy(buff,(const char*)win.cFileName);
  19.                 strcat(buff," , ");            
  20.  
  21.                 while(FindNextFile(han,&win))
  22.                 {
  23.                     strcat(buff,win.cFileName);
  24.                     strcat(buff," , ");
  25.                 }
  26.                 std::cout << buff << std::endl;
  27.                 CloseHandle(han);
  28.             }
  29.         };
  30. private: vector<string> files;
  31. };
  32.  
  33.  
  34. int main()
  35. {
  36.     Config config;
  37.     config.AllFiles();
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement