1、打开相应格式文件:
private void btnSharePath_Click(object sender, EventArgs e)
{
OpenFileDialog openShare = new OpenFileDialog();
openShare.Filter = "Excel Files(*.xls,*.xlsx)|*.xls;*.xlsx";
if (openShare.ShowDialog() == DialogResult.OK)
{
txtSharePath.Text =openShare.FileName;
}
}
2、设置文件夹路径:FolderBrowserDialog()
3、设置文件保存路径:SaveFileDialog()