I have a checkedListBox
and in collection items I want to add what I have in a text file installer.ini
after #product=name of checkbox
. How I can do this ?
Something like this :
var lines = System.IO.File.ReadAllLines(path + "installer.ini");
var items = new List<string>();
lines.Where(x => x.StartsWith("#product="))
.Select(x =>x.Replace("#product=", "").Trim())
.ToList()
.ForEach(item =>
{
string line;
items.Add(line);
}
);
checkedListBox2.AddRange( items );
}