private void button4_Click(object sender, EventArgs e) { FileName = textBox3.Text; Dir = textBox2.Text; if (FileName.EndsWith(".txt")) { instance = new TXT(FileName, Dir); } else if (FileName.EndsWith(".doc")) { instance = new DOC(FileName, Dir); } MessageBox.Show(instance.EditFile(textBox1.Text)); }
private void button3_Click(object sender, EventArgs e) { FileName = textBox3.Text; Dir = textBox2.Text; if (FileName.EndsWith(".txt")) { instance = new TXT(FileName, Dir); } else if (FileName.EndsWith(".doc")) { instance = new DOC(FileName, Dir); } textBox1.Text = instance.OpenFile(); }