I am writing an application using C# and I would like to read some parameters from an external file like for example a text file. The parameters will be saved in the file in the form of
parA = 5
parB = hello
etc
Can you pleas suggest a way how I can do this?
var settings =
from line in File.ReadAllLines("params.txt")
let parameters = line.Split('=')
select new KeyValuePair<string, string>(parameters[0], parameters[1]);