private void button4_Click(object sender, EventArgs e) { if (File.Exists(".\\config.cfg")) { Simple_QEMU.ImgTools imgtools = new Simple_QEMU.ImgTools(); imgtools.Show(); } else { MessageBox.Show("config.cfg 不存在!请重新设置!", "Error:114514", MessageBoxButtons.OK, MessageBoxIcon.Error); Simple_QEMU.GQP gqp = new Simple_QEMU.GQP(); gqp.Show(); } }
private void NewVM_Load(object sender, EventArgs e) { if (!File.Exists(".\\VMC\\" + Manager.pathstr + ".sqc")) { if (File.Exists(Application.StartupPath + "\\config.cfg")) { StreamReader sr = new StreamReader(Application.StartupPath + "\\config.cfg", Encoding.Default); String str = sr.ReadToEnd(); string[] strs = str.Split(new string[] { "\n" }, StringSplitOptions.None); sr.Close(); comboBox_x86.SelectedIndex = 0; comboBox_CPU.SelectedIndex = 0; comboBox_vga.SelectedIndex = 0; comboBox_sound.SelectedIndex = 0; comboBox_network.SelectedIndex = 0; comboBox1.SelectedIndex = 0; textBox_QPath.Text = strs[0]; } else { MessageBox.Show("你没有设置全局QEMU路径请前往设置!", "Error: Not Found QEMU Path", MessageBoxButtons.OK, MessageBoxIcon.Error); Hide(); Simple_QEMU.GQP gqp = new Simple_QEMU.GQP(); gqp.Show(); Close(); } } else { try { StreamReader sr = new StreamReader(".\\VMC\\" + Manager.pathstr + ".sqc", Encoding.Default); String str1 = sr.ReadToEnd(); string[] str2 = str1.Split(new string[] { "\n" }, StringSplitOptions.None); sr.Close(); textBox_name.Text = Manager.pathstr; textBox_QPath.Text = str2[1]; comboBox_x86.SelectedIndex = Convert.ToInt32(str2[2]); comboBox_CPU.SelectedIndex = Convert.ToInt32(str2[3]); textBox_core.Text = str2[4]; textBox_mb.Text = str2[5]; t_D1.Text = str2[6]; t_D2.Text = str2[7]; t_D3.Text = str2[8]; t_D4.Text = str2[9]; t_cd.Text = str2[10]; comboBox_vga.SelectedIndex = Convert.ToInt32(str2[11]); comboBox_sound.SelectedIndex = Convert.ToInt32(str2[12]); comboBox_network.SelectedIndex = Convert.ToInt32(str2[13]); checkBox_cd.Checked = Convert.ToBoolean(str2[14]); checkBox1.Checked = Convert.ToBoolean(str2[15]);//vnc textBox_sf.Text = str2[16]; checkBox_HAXM.Checked = Convert.ToBoolean(str2[17]); } catch (Exception e1) { MessageBox.Show(e1.ToString(), "Error:1919", MessageBoxButtons.OK, MessageBoxIcon.Error); } //读取文件 } if (!Directory.Exists(".\\VMC")) { Directory.CreateDirectory(".\\VMC"); } }
private void button5_Click(object sender, EventArgs e) { Simple_QEMU.GQP gpq = new Simple_QEMU.GQP(); gpq.Show(); }