Ejemplo n.º 1
0
        private void 编辑ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex > -1)
            {
                string[] str1;
                string[] str2;
                filepath_edit = listBox1.SelectedItem.ToString();
                str1          = filepath_edit.Split(new string[] { "\\VMS\\" }, StringSplitOptions.None);
                str2          = str1[1].Split(new string[] { ".bat" }, StringSplitOptions.None);
                pathstr       = str2[0];
                //MessageBox.Show(pathstr,"a");
                NewVM newvm = new NewVM();
                newvm.Show();
            }
            else
            {
                MessageBox.Show("编辑不能", "错误 Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //暂时使用编辑框

            /*
             * Process p = new Process();
             * p.StartInfo.FileName = "cmd.exe";
             * p.StartInfo.UseShellExecute = false;
             * p.StartInfo.RedirectStandardInput = true;
             * p.StartInfo.RedirectStandardOutput = true;
             * p.StartInfo.RedirectStandardError = true;
             * p.StartInfo.CreateNoWindow = true;
             * p.Start();
             * p.StandardInput.WriteLine("notepad " + listBox1.SelectedItem.ToString() + "&exit");
             * p.StandardInput.AutoFlush = true;
             * p.WaitForExit();
             * p.Close();*/
        }
Ejemplo n.º 2
0
        private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewVM new1 = new NewVM();

            new1.Show();
        }