I wont to grab few lines from a text in to my textbox and chould not figure out on how to do it with when there is more then one line to take.
For example my text includes this lines :
Now I need to have :PHP Code:Location : Utah
Season : Pre-Rut
Time : 04/13/12 19:42:18
Duration : 15 minutes
Game type : Best_Trophy
Difficulty: Expert
Result : Game_has_a_winner!
Players : 2
1. "Brian" is a Winner!
Trophy(ies) : 4
Score : 428.747
Best Trophy : Male Whitetail
Points : Total (428.747) = Animal score (150.010)
Distance : 246.07 meters
2. "stefano sorsoli
Location : + Time : + Animal score in one line on my textbox .
I used this :
but this doesnt work.Code:List<string> data = new List<string>(); using (StreamReader sr = new StreamReader(textBox1.Text + @"\Game\Game.LOG")) { while (sr.Peek() > -1) { string ln = sr.ReadLine(); if (ln.Contains("Location :")) + (" Time :")) + (" Animal score ") { string values = (from Match m in Regex.Matches(ln, @"""(.*?)""", RegexOptions.IgnoreCase) select m.Value).ToArray()[0]; textBox3.Text = ("All Time Winner is : " + values.Replace((char)34, '\n')); } } }




Reply With Quote