I have some ini file include this string : _DeviceName = #1234. Now I want to get the _DeviceName value that is 1234 but it shows me the full string that is _DeviceName = #1234.
I tried this code:
if (File.Exists("inifile.ini"))
{
if (File.ReadAllText("inifile.ini").Split('\r', '\n').First(st => st.StartsWith("_DeviceName")) != null)
{
string s = File.ReadAllText("inifile.ini").Split('\r', '\n').First(st => st.StartsWith("_DeviceName"));
MessageBox.Show(s);
}
}