Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- List<string> bdc = new List<string>();
- List<string> bdl = new List<string>();
- List<string> car = new List<string>();
- List<string> dem = new List<string>();
- List<string> cfg = new List<string>();
- List<string> lang = new List<string>();
- List<string> fbl = new List<string>();
- List<string> fpa = new List<string>();
- List<string> fsp = new List<string>();
- List<string> hnr = new List<string>();
- List<string> phoneme = new List<string>();
- List<string> poi = new List<string>();
- List<string> scheme = new List<string>();
- List<string> speedcam = new List<string>();
- List<string> tmc = new List<string>();
- List<string> voice = new List<string>();
- List<string> vr = new List<string>();
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- OpenFileDialog theDialog = new OpenFileDialog();
- theDialog.Title = "Open Text File";
- theDialog.Filter = "TXT files|*.txt";
- theDialog.InitialDirectory = @"C:\";
- if (theDialog.ShowDialog() == DialogResult.OK)
- {
- string filename = theDialog.FileName;
- }
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- string selected = comboBox1.Text;
- using (StreamReader sr = new StreamReader(filename))
- {
- string line;
- while ((line = sr.ReadLine()) != null)
- {
- if (line.Contains("dem"))
- {
- dem.Add(line);
- }
- if (line.Contains("cfg"))
- {
- cfg.Add(line);
- }
- if (line.Contains("lang"))
- {
- lang.Add(line);
- }
- if (line.Contains("fbl"))
- {
- fbl.Add(line);
- }
- if (line.Contains("fpa"))
- {
- fpa.Add(line);
- }
- if (line.Contains("fsp"))
- {
- fsp.Add(line);
- }
- if (line.Contains("hnr"))
- {
- hnr.Add(line);
- }
- if (line.Contains("phoneme"))
- {
- phoneme.Add(line);
- }
- if (line.Contains("poi"))
- {
- poi.Add(line);
- }
- if (line.Contains("scheme"))
- {
- scheme.Add(line);
- }
- if (line.Contains("speedcam"))
- {
- speedcam.Add(line);
- }
- if (line.Contains("tmc"))
- {
- tmc.Add(line);
- }
- if (line.Contains("voice"))
- {
- voice.Add(line);
- }
- if (line.Contains("asr") & line.Contains("vr"))
- {
- vr.Add(line);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement