OpenFileDialog fileDialog1 = new OpenFileDialog();
fileDialog1.InitialDirectory = “d:";
fileDialog1.Filter = “xls files (*.xls)|*.xls|All files (*.*)|*.*”;
fileDialog1.FilterIndex = 1;
fileDialog1.RestoreDirectory = true;
if (fileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = fileDialog1.FileName;
}
else
{
textBox1.Text = “”;
}