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()

posted on 2013-02-19 11:09  苍之青澄  阅读(523)  评论(0编辑  收藏  举报