OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Title = "Attach Document file (PDF)";
openFileDialog1.CheckFileExists = true;
openFileDialog1.CheckPathExists = true;
openFileDialog1.DefaultExt = "txt";
openFileDialog1.Filter = "PDF file (*.pdf)|*.pdf";
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
openFileDialog1.ReadOnlyChecked = true;
openFileDialog1.ShowReadOnly = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
txtFileAddress.Text = openFileDialog1.FileName;
}
openFileDialog1.Title = "Attach Document file (PDF)";
openFileDialog1.CheckFileExists = true;
openFileDialog1.CheckPathExists = true;
openFileDialog1.DefaultExt = "txt";
openFileDialog1.Filter = "PDF file (*.pdf)|*.pdf";
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
openFileDialog1.ReadOnlyChecked = true;
openFileDialog1.ShowReadOnly = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
txtFileAddress.Text = openFileDialog1.FileName;
}