拖一个textbox控件
private void btnSelect_Click(object sender, EventArgs e)
{
//选择文件
OpenFileDialog op = new OpenFileDialog();
if (op.ShowDialog() == DialogResult.OK)
{
textBox1.Text = op.FileName;
}
//选择文件夹
FolderBrowserDialog fo = new FolderBrowserDialog();
if (fo.ShowDialog() == DialogResult.OK)
{
textBox1.Text = fo.SelectedPath;
}
}