private void OpenFile(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); openFileDialog.Filter = "Exe Files (*.exe)|*.exe|Dynamic Libary Files (*.dll)|*.dll|Driver Files (*.ocx)|*.ocx|Memory Images Files (*.com)|*.com|System Files (*.sys)|*.sys|All Files (*.*)|*.*"; if (openFileDialog.ShowDialog(this) == DialogResult.OK) { if (File.Exists(openFileDialog.FileName)) { pChildForm = new FileForm(); pChildForm.MdiParent = this; pChildForm.Text = openFileDialog.FileName.Substring(openFileDialog.FileName.LastIndexOf("\\") + 1); pChildForm.Show(); try { pChildForm.OpenPEFile(openFileDialog.FileName); pChildForm.DrawSummary(); } catch (ArgumentException ex) { MessageBox.Show(ex.Message); return; } } } }
private void exportToolStripMenuItem_Click(object sender, EventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); DialogResult dr = fbd.ShowDialog(); if (pChildForm != null) { if (fbd.SelectedPath != "") { pChildForm = (FileForm)this.ActiveMdiChild; pChildForm.Export(fbd.SelectedPath); } } else { MessageBox.Show("请先打开需要输出的文件。"); } }