I have written this code to get the file in a directory, now i want to make it open the .txt & .ini & .docx and print this line: "=== THIS FILE HAS BEEN COMPRIMIZED ==="; in the file, need help with that code please.
Here is my code to get the files:
#include<iostream>
#include<string>
#include<wtypes.h>
using namespace std;
int main()
{
HANDLE FindHandle = INVALID_HANDLE_VALUE;
WIN32_FIND_DATA FindData;
string FileName = ".\\*.*"; // . specifies the current directory
FindHandle = FindFirstFile(FileName.c_str(), &FindData);
if (INVALID_HANDLE_VALUE != FindHandle)
{
do
{
cout << FindData.cFileName << '\n';
} while (FindNextFile(FindHandle, &FindData) != 0);
FindClose(FindHandle);
}
return 0;
}
Thanks...