码迷,mamicode.com
首页 > Windows程序 > 详细

c# 通过按钮获取文件夹和打开磁盘文件

时间:2017-09-27 19:10:35      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:start   sele   roc   new   ted   tar   selected   exe   text   

Button控件获取文件夹:

1  FolderBrowserDialog fileDialog = new FolderBrowserDialog();
2  if (fileDialog.ShowDialog() == DialogResult.OK)
3  {
4     MessageBox.Show(fileDialog.SelectedPath);
5  }


Button打开磁盘文件夹:

 1 System.Diagnostics.Process.Start("explorer.exe", FilePath); 

 

c# 通过按钮获取文件夹和打开磁盘文件

标签:start   sele   roc   new   ted   tar   selected   exe   text   

原文地址:http://www.cnblogs.com/hbtmwangjin/p/7602807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!