private void importBrowseBtn_Click(object sender, EventArgs e)
{
//选择文件框对象
OpenFileDialog ofd = new OpenFileDialog();
//打开时指定默认路径
ofd.InitialDirectory = @"C:";
//指定选择文件类型(类型筛选)
ofd.Filter = "文本文件|*.txt";
//如果用户点击确定
if (ofd.ShowDialog() == DialogResult.OK)
{
//将用户选择的文件路径显示在文本框中
importPath.Text = ofd.FileName;
}
}