I have a text file installer.ini
where I have a row who is like : fileExecutable=D:\location
. I want to get the text after =
and put in a variable. After that I want to use that variable instead of D:\location
in code.
foreach (var txt in lin)
{
if (txt.Contains("fileExecutable="))
{
var ExeFile = txt.Split('=')[1];
}
}
// The installer itself
process.StartInfo.FileName = @"D:\location";
process.StartInfo.Arguments = @"-if C:\temp\installer.ini";
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
process.WaitForExit();
}
I try to put in the variable ExeFile
what I have in text file after fileExecutable=
and use that variable in this row: process.StartInfo.FileName = @"D:\location";