Beispiel #1
0
        private void StartButton_Click(object sender, EventArgs e)
        {
            string  NewProc = StartTextBox.Text;
            Process process = new Process();

            process.StartInfo.FileName = NewProc;
            try
            {
                process.Start();
            }
            catch (System.ComponentModel.Win32Exception)
            {
                MessageBox.Show("Invalid input, no process found!");
            }
            StartTextBox.Clear();
            UpdateListBox();
        }
        private void StartTask_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(StartTextBox.Text))
            {
                try
                {
                    Process proc = new Process();
                    proc.StartInfo.FileName = StartTextBox.Text;
                    proc.Start();
                    notifyIcon1.ShowBalloonTip(100, "Brett Tech Networking", (StartTextBox.Text + " Started"), ToolTipIcon.Info);
                }

                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    StartTextBox.Clear();
                }
            }
        }