Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <vector>
- using namespace std;
- class Config
- {
- public:
- void AllFiles()
- {
- WIN32_FIND_DATA win;
- HANDLE han;
- char *buff=new char[255];
- han= FindFirstFile(TEXT("C:\\new\\*.*"),&win);
- if(han!=INVALID_HANDLE_VALUE)
- {
- strcpy(buff,(const char*)win.cFileName);
- strcat(buff," , ");
- while(FindNextFile(han,&win))
- {
- strcat(buff,win.cFileName);
- strcat(buff," , ");
- }
- std::cout << buff << std::endl;
- CloseHandle(han);
- }
- };
- private: vector<string> files;
- };
- int main()
- {
- Config config;
- config.AllFiles();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement