public ResultOfTest Parsing(string s) { var A = new ResultOfTest(); string[] SL = Regex.Split(s, "ФИО:(.*) Дата и время:(.*) Язык:(.*) Длительность:(.*) Верно:(.*) из (.*)"); A.Lang = SL[3]; A.Lenght = Int32.Parse(SL[6]); A.Name = SL[1]; A.Score_Test = Int32.Parse(SL[5]); A.Test_Time = SL[4]; A.Date_Time = DateTime.Parse(SL[2]); return A; }
private void Fix_Click(object sender, EventArgs e) { Fix.Text = "Зафиксировать"; if (textBox3.Text == string.Empty) { label7.Visible = true; return; } else { label11.Text = string.Empty; test = new ResultOfTest(); test.Name = textBox3.Text; test.Lenght = LenghtTest; test.Score_Test = score; test.Test_Time = ResultTime; test.Date_Time = System.DateTime.Now; if (En.Checked == true && Ru.Checked == true) test.Lang = "RUS/ENG"; else if (Ru.Checked == true && En.Checked != true) test.Lang = "RUS"; else test.Lang = "ENG"; listBox1.Items.Add(test); Fix.Enabled = false; En.Enabled = true; Ru.Enabled = true; trackBar1.Enabled = true; } }