예제 #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     //new window
     if (textBox1.Text != "")
     {
         listBox1.Items.Add("window: " + textBox1.Text);
         target temp = new target(false, textBox1.Text);
         t.Add(temp);
         textBox1.Text = "";
         textBox1.Focus();
         listBox1.SelectedIndex = listBox1.Items.Count - 1;
     }
 }
예제 #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     //new process
     if (textBox1.Text != "")
     {
         listBox1.Items.Add("process: " + textBox1.Text);
         target temp = new target(true, textBox1.Text);
         t.Add(temp);
         textBox1.Text = "";
         textBox1.Focus();
         listBox1.SelectedIndex = listBox1.Items.Count - 1;
     }
 }
예제 #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            string windows = txt.read(windowsPath), processes = txt.read(processesPath);

            string[] exwin = windows.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            string[] expro = processes.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            for (int i = 0; i < exwin.Length; i++)
            {
                target temp = new target(false, exwin[i]);
                t.Add(temp);
                listBox1.Items.Add("window: " + exwin[i]);
            }

            for (int i = 0; i < expro.Length; i++)
            {
                target temp = new target(true, expro[i]);
                t.Add(temp);
                listBox1.Items.Add("process: " + expro[i]);
            }
        }