using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms; namespace TestFolderBrowserDialog
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void btnFile_Click(object sender, EventArgs e)
{
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.Multiselect = true;
fileDialog.Title = "请选择文件";
fileDialog.Filter="所有文件(*.*)|*.*";
if (fileDialog.ShowDialog() == DialogResult.OK)
{
string file=fileDialog.FileName;
MessageBox.Show("已选择文件:" + file,"选择文件提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
} private void btnPath_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.Description = "请选择文件路径";
if (dialog.ShowDialog() == DialogResult.OK)
{
string foldPath = dialog.SelectedPath;
MessageBox.Show("已选择文件夹:" + foldPath, "选择文件夹提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
} private void btnOpen_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Explorer.exe","c:\\windows");
}
}
}

最新文章

  1. TransmitFile函数的简单使用
  2. MCV之行为
  3. 响应性web设计实战总结
  4. Mac OS X 中使用SAP GUI的方法
  5. HTML5 WebAudioAPI-实例(二)
  6. C++引用形参,函数返回多个值
  7. k8s集群监控(十一)--技术流ken
  8. 简单的shell命令
  9. openflow流表分析(草稿)
  10. Mybatis的bind动态SQL
  11. (简单)华为M3揽月 BTV-W09的Usb调试模式在哪里开启的经验
  12. MySQL的视图总结
  13. Linux系统下yum镜像源环境部署记录
  14. 拖放排序插件Sortable.js 兼容好及功能全个人觉得比dragula.js 好的多
  15. cookie 简单用法
  16. SEO优化之“不要轻易使用泛解析”
  17. 23.Xcode中常用的快捷键操作
  18. 事件委托,js中的一种优化方法
  19. 数据库索引&数据页
  20. SCARA——OpenGL入门学习三

热门文章

  1. PowerDesigner16.5 生成SQL脚本执行出错:collate chinese_prc_ci_as
  2. javascript笔记——date以及datetime的比较
  3. css笔记——inline-block以及空白字符处理
  4. makefile--编译出现,未定义的字符
  5. [ZZ+CH] Html5 canvas+js 时钟
  6. Mysql 作业(Scheduler)
  7. ajax返回的json内容进行排序
  8. [WinForm]为TextBox设置水印文字
  9. [译]Java Thread wait, notify和notifyAll示例
  10. dapper.rainbow