private void button2_Click(object sender, EventArgs e) { string filepath = this.filepath.Text; string target = this.target.Text; if (filepath == null || filepath == "") { MessageBox.Show("文件路径为空!"); } else if (target == null || target == "") { MessageBox.Show("请输入匹配字符串"); } FileOutput fo = new FileOutput(); fo.regex(filepath, target); }
private void outputExcel(object sender, EventArgs e) { if (result == null) { MessageBox.Show("尚未解析imodel"); } else { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Excel(*.xlsx)|*.xlsx"; if (sfd.ShowDialog() == DialogResult.OK) { string filepath = sfd.FileName.ToString(); FileOutput fo = new FileOutput(); fo.outputExcel(filepath, result); } } }