Winform选择目录路径与选择文件路径
2016-09-13 18:24
351 查看
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsApplication1 { public partial class SelectFolder: Form { public SelectFolder() { InitializeComponent(); } private void btnSelectPath_Click(object sender, EventArgs e) //弹出一个选择目录的对话框 { FolderBrowserDialog path = new FolderBrowserDialog(); path.ShowDialog(); this.txtPath.Text = path.SelectedPath; } private void btnSelectFile_Click(object sender, EventArgs e) //弹出一个选择文件的对话框 { OpenFileDialog file = new OpenFileDialog(); file.ShowDialog(); this.txtFile.Text = file.SafeFileName; } } }
相关文章推荐
- Winform选择目录路径与选择文件路径
- C# WinForm 选择目录路径和文件路径
- Winform选择目录路径与选择文件路径
- Winform选择目录路径与选择文件路径
- Winform选择目录路径与选择文件路径
- Winform窗体文本框实现拖拽获得目录或文件路径(C#)
- c#winform选择文件,文件夹,打开指定目录方法
- WPF 获取文件夹路径,目录路径,复制文件,选择下载文件夹/目录
- Qt-编程模块 001: 浏览(选择)、打开 文件和文件夹(目录) --- 如何让按钮**记忆上次打开的文本路径**的功能
- C# winform中选择本地文件,并获取其路径
- MFC选择目录SHBrowseForFolder选择文件CFileDialog对话框设置默认路径
- c#winform选择文件,文件夹,打开指定目录方法
- C#winForm窗体,以窗口对话形式选择文件夹、文件路径
- c#winform选择文件,文件夹,打开指定目录方法
- MFC选择目录SHBrowseForFolder选择文件CFileDialog对话框设置默认路径
- VC选择 文件 或 目录 路径的代码
- c#winform选择文件,文件夹,打开指定目录方法
- MFC选择目录SHBrowseForFolder选择文件CFileDialog对话框设置默认路径
- SVN导出文件的时候选择路径不小心选择了盘符根目录
- c#Winform程序调用app.config文件配置数据库连接字符串 SQL Server文章目录 浅谈SQL Server中统计对于查询的影响 有关索引的DMV SQL Server中的执行引擎入门 【译】表变量和临时表的比较 对于表列数据类型选择的一点思考 SQL Server复制入门(一)----复制简介 操作系统中的进程与线程