private void button2_Click(object sender, EventArgs e) { var index = new GUIDIndex(); index.Name = textBox1.Text; index.Date = DateTime.Now; index.Guid = GenGuid(); comboBox1.Items.Add(index); comboBox1.SelectedItem = index; }
private void LoadValues() { if (File.Exists(_fileName)) { using (var sr = new StreamReader(_fileName, Encoding.Unicode)) { while (!sr.EndOfStream) { string line = sr.ReadLine(); string[] split = line.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries); var index = new GUIDIndex(); index.Name = split[0]; index.Date = DateTime.Parse(split[1]); index.Guid = new Guid(split[2]); comboBox1.Items.Add(index); } } } }
private void LoadValues() { if (File.Exists(_fileName)) { using (var sr = new StreamReader(_fileName, Encoding.Unicode)) { while (!sr.EndOfStream) { string line = sr.ReadLine(); string[] split = line.Split(new[] {'|'}, StringSplitOptions.RemoveEmptyEntries); var index = new GUIDIndex(); index.Name = split[0]; index.Date = DateTime.Parse(split[1]); index.Guid = new Guid(split[2]); comboBox1.Items.Add(index); } } } }