OpenFileDialog ofdMyDialog = new OpenFileDialog();
ofdMyDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
ofdMyDialog.CheckFileExists = true;
string strFileName = string.empty;
if (ofdMyDialog.ShowDialog() == DialogResult.OK)
{
// They clicked the ok button, should have a pathname here
strFileName = ofdMyDialog.FileName;
}