使用C#选择文件夹、打开文件夹、选择文件
来源:互联网 发布:psp搜索数据 编辑:程序博客网 时间:2024/05/17 01:53
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");
}
}
}
- C#选择文件、选择文件夹、打开文件夹
- 使用C#选择文件夹、打开文件夹、选择文件
- 使用C#选择文件夹、打开文件夹、选择文件
- 使用C#选择文件夹、打开文件夹、选择文件
- 使用C#选择文件夹、打开文件夹、选择文件
- 使用C#选择文件夹、打开文件夹、选择文件
- 使用C#选择文件夹、打开文件夹、选择文件
- 使用C#选择文件夹、打开文件夹、选择文件
- 使用C#选择文件夹、打开文件夹、选择文件
- 使用C#选择文件夹、打开文件夹、选择文件或者如何使用C#选择文件夹
- C#选择文件、选择文件夹、打开文件(或者文件夹)
- C#选择文件、选择文件夹、打开文件(或者文件夹)
- C#选择文件、选择文件夹、打开文件(或者文件夹)
- C#选择文件、选择文件夹、打开文件(或者文件夹)
- C#选择文件 文件夹
- 打开选择文件夹或文件
- C#选择文件和文件夹
- C# 文件对话框选择文件夹
- 插入排序
- 由于/var/lib目录权限导致SSH不能用
- Spark源码阅读笔记之Broadcast(三)
- mysql源码安装
- 集成CCFlow工作流与GPM的办公系统驰骋CCOA介绍(三)
- 使用C#选择文件夹、打开文件夹、选择文件
- 估算鱼的条数
- Nhibernate 三种配置方式
- 将坐标换算成百分比及批量坐标的换算
- XML Parser Error on line 1: 前言中不允许有内容。
- JVM学习笔记--Java运行时数据区
- pcap的用法
- 解决了在ScrollPane中加Jtable不能显示的问题
- linux 系统每天自动重启的方法