open file C#
private void button13_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Word Documents(*.doc)|*.doc";
ofd.ShowDialog();
textBox3.Text = ofd.FileName;
}
private void button12_Click(object sender, EventArgs e)
{
if (textBox3.Text.Length > 0)
{
readFileContent(textBox3.Text);
}
else
{
MessageBox.Show("Enter a valid file path");
}
}
private void readFileContent(string path)
{
...
}