Reading from text file

Posts 1–2 of 2 · Page 1 of 1
Reading from text file
Hey,

Alright so I made an application with VB that writes some text strings into blabla.txt.
Example:
WEAPON1=5412
WEAPON2=4444
etc.

Now when my DLL is injected, I need my dll to read those numeric values.
Any source, or code?

Thanks!
This is 'only' the skeleton. You can use this to test your stuff.
Code:
#include <iostream>
#include <fstream>
#include <string>;

using namespace std;

//...

ifstream File;
string Weapon1;//We will save our data in this string
File.open("file.txt", ios_base::in);
if(File)
{
	//Opened the file
	getline(File, Weapon1);//Read the data and save it in our string
}
else
{
	//Couldn't open the file
}
It's possible to convert the string into an integer or whatever you want.
If you have any questions, ask
Give Credits btw

Edit:
If you want to read more than one line, just use getline() again. If you call it the first time it reads the 1st line, the 2nd time it reads the 2nd line an so on ..
I wrote a simple console app to be sure that I didn't tell shit


Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?