Hello.
I am making a win app wich I can use to replace values in a .ini file.
In this example.ini file I want to change the values after the =
location
{
x=0.35
y=0.56
z=-0.5
}
I have label1, 2, 3 with text: "x, y, z" and want to get values after =. to texBox1, 2, 3 wich I then can replace and send back. This with 2 buttons with text: Get value, Return value.
I have tried this code but dosent work for me becouse the values are not always on the same lines in the different .ini files.
I dont have anything yet for saving the value back to the string
StreamReader reader = new StreamReader("example.ini");
string strAllFile = reader.ReadToEnd().Replace("\r\n", "\n").Replace("\n\r", "\n");
string[] arrLines = strAllFile.Split(new char[] { '\n' });
textBox1.Text = arrLines [375];
textBox2.Text = arrLines[397];
textBox3.Text = arrLines[370];
reader.Close();
I am complete noob, but reading and learning everyday. I would appreciate if someone could help me out a bit!