Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.21 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11.  
  12. namespace WindowsFormsApplication1
  13. {
  14.    
  15.     public partial class Form1 : Form
  16.     {
  17.         List<string> bdc = new List<string>();
  18.         List<string> bdl = new List<string>();
  19.         List<string> car = new List<string>();
  20.         List<string> dem = new List<string>();
  21.         List<string> cfg = new List<string>();
  22.         List<string> lang = new List<string>();
  23.         List<string> fbl = new List<string>();
  24.         List<string> fpa = new List<string>();
  25.         List<string> fsp = new List<string>();
  26.         List<string> hnr = new List<string>();
  27.         List<string> phoneme = new List<string>();
  28.         List<string> poi = new List<string>();
  29.         List<string> scheme = new List<string>();
  30.         List<string> speedcam = new List<string>();
  31.         List<string> tmc = new List<string>();
  32.         List<string> voice = new List<string>();
  33.         List<string> vr = new List<string>();
  34.  
  35.         public Form1()
  36.         {
  37.             InitializeComponent();        
  38.         }
  39.  
  40.         private void button1_Click(object sender, EventArgs e)
  41.         {
  42.                
  43.             OpenFileDialog theDialog = new OpenFileDialog();
  44.             theDialog.Title = "Open Text File";
  45.             theDialog.Filter = "TXT files|*.txt";
  46.             theDialog.InitialDirectory = @"C:\";
  47.             if (theDialog.ShowDialog() == DialogResult.OK)
  48.             {
  49.                 string filename = theDialog.FileName;
  50.             }
  51.         }
  52.  
  53.             private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  54.             {
  55.                 string selected = comboBox1.Text;
  56.                 using (StreamReader sr = new StreamReader(filename))
  57.                 {
  58.                     string line;
  59.                     while ((line = sr.ReadLine()) != null)
  60.                     {
  61.                         if (line.Contains("dem"))
  62.                         {
  63.                             dem.Add(line);
  64.                         }
  65.                         if (line.Contains("cfg"))
  66.                         {
  67.                             cfg.Add(line);
  68.                         }
  69.                         if (line.Contains("lang"))
  70.                         {
  71.                             lang.Add(line);
  72.                         }
  73.                         if (line.Contains("fbl"))
  74.                         {
  75.                             fbl.Add(line);
  76.                         }
  77.                         if (line.Contains("fpa"))
  78.                         {
  79.                             fpa.Add(line);
  80.                         }
  81.                         if (line.Contains("fsp"))
  82.                         {
  83.                             fsp.Add(line);
  84.                         }
  85.                         if (line.Contains("hnr"))
  86.                         {
  87.                             hnr.Add(line);
  88.                         }
  89.                         if (line.Contains("phoneme"))
  90.                         {
  91.                             phoneme.Add(line);
  92.                         }
  93.                         if (line.Contains("poi"))
  94.                         {
  95.                             poi.Add(line);
  96.                         }
  97.                         if (line.Contains("scheme"))
  98.                         {
  99.                             scheme.Add(line);
  100.                         }
  101.                         if (line.Contains("speedcam"))
  102.                         {
  103.                             speedcam.Add(line);
  104.                         }
  105.                         if (line.Contains("tmc"))
  106.                         {
  107.                             tmc.Add(line);
  108.                         }
  109.                         if (line.Contains("voice"))
  110.                         {
  111.                             voice.Add(line);
  112.                         }
  113.                         if (line.Contains("asr") & line.Contains("vr"))
  114.                         {
  115.                             vr.Add(line);
  116.                         }
  117.                     }
  118.  
  119.                 }
  120.             }
  121.  
  122.  
  123.             }
  124.  
  125.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement