Hello, my name is Sandra.
I have been bothering myself for few days with this issue.
So I'm trying to create a code that will read from text file named "files.txt" and paste the 2nd line from that text file to somewhere else, like an opened window.
void ReadFiles ()
{
ifstream read ( "files.txt" );
string my_string;
int counter = 0;
while (getline(read, my_string, '\n'))
{
if (counter ==1 )
{
}
counter = counter + 1;
}
read.close();
}
I'm using that line of code to read 2nd line from my text file, and save it as my_string, and I have no problem with it, it works correctly.
Part that bothers me is that I have for an example opened empty notepad file, and when I execute this program I want it to just paste, the my_string text, the part which he took from 2nd line of text file.
In my case I don't want it to paste it into notepad file, just to paste it into one username section box on one application.
I tried with saving the string to clipboard and then using SendKeys to send CTRL+V, but it didn't end up working.
Can you please help?
Ty.