(一)具体教程查看:011——C#创建ECXEL文件(附教程)

(二)代码:foldPath 就是获取到的文件路径

private void button1_Click(object sender, EventArgs e)
{

                       FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.Description = "请选择文件路径";
string foldPath = "";
if (dialog.ShowDialog() == DialogResult.OK)
{
foldPath = dialog.SelectedPath + @"\";
}
textBox1.Text = foldPath;
}

010——C#选择文件路径的更多相关文章

  1. windows API实现用户选择文件路径的对话框

    在编写应用程序时,有时需要用户选择某个文件,以供应用程序使用,比如在某些管理程序中需要打开某一个进程,这个时候需要弹出一个对话框来将文件路径以树形图的形式表示出来,以图形化的方式供用户选择文件路径,而 ...

  2. Qt选择文件路径

    QString file_path = QFileDialog::getExistingDirectory(this, "请选择文件路径...", "./"); ...

  3. C# 选择文件路径,选择文件

    // 选择文件: private string SelectPath() { string path = string.Empty; var openFileDialog = new Microsof ...

  4. Winform选择目录路径与选择文件路径

    https://blog.csdn.net/zaocha321/article/details/52528279 using System.Collections.Generic; using Sys ...

  5. c#winform选择文件,文件夹,打开指定目录方法

    private void btnFile_Click(object sender, EventArgs e) { OpenFileDialog fileDialog = new OpenFileDia ...

  6. 使用C#选择文件夹、打开文件夹、选择文件

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  7. C#选择文件、选择文件夹、打开文件

    1.选择文件用OpenDialog OpenFileDialog dialog = new OpenFileDialog(); dialog.Multiselect = true;//该值确定是否可以 ...

  8. C# winform 选择文件保存路径

    1.winform 点击按钮选择文件保存的路径,效果如下图: 具体代码如下: private void button8_Click(object sender, EventArgs e) { Fold ...

  9. C# winform文件批量转编码 选择文件夹

    C# winform文件批量转编码 选择文件夹 打开指定目录 private void btnFile_Click(object sender, EventArgs e) { OpenFileDial ...

随机推荐

  1. CentOS 7.6出现SSH登录失败的解决方法

    CentOS 7.6出现SSH登录失败的解决方案 问题重现: iterm登录 ssh vagrant@192.168.10.10 The authenticity of host '192.168.1 ...

  2. c#序列化基类(包含派生类继承DynamicObject和 IXmlSerializable)对象

    直接上代码 using System.Diagnostics; using System.Text; using System.Xml; using System.Xml.Schema; using ...

  3. 高可用etcd集群(三节点) + ssl双向认证

    # etcd下载地址 https://github.com/etcd-io/etcd/tags wget https://github.com/etcd-io/etcd/releases/downlo ...

  4. PAT(A) 1148 Werewolf - Simple Version(Java)逻辑推理

    题目链接:1148 Werewolf - Simple Version (20 point(s)) Description Werewolf(狼人杀) is a game in which the p ...

  5. 微信公众号h5页面自定义分享

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  6. springboot调用mongo

    目录 添加 删除 文档操作更新 简单聚合操作 count, distinct 普通查询 分组 group Aggregate mapReduce 分页查询 文件上传 文件下载 随便测试了一下,有问题请 ...

  7. flutter从入门到精通一

    Flutter 是 Google 开源的 UI 工具包,帮助开发者通过一套代码库高效构建多平台精美应用,支持移动.Web.桌面和嵌入式平台 flutter是基于dart语言开发的,我们将首先通过几章节 ...

  8. 使用async和await的异步编程

    异步编程模型(TAP)提供了抽象的异步代码.异步代码看起来和同步代码没什么大的区别,无非多个了两个关键字(async和await).但是代码的执行顺序并没看起来那么简单,代码的执行顺序根据cpu资源的 ...

  9. 笔记 - C#从头开始构建编译器 - 2

    视频与PR:https://github.com/terrajobst/minsk/blob/master/docs/episode-02.md 作者是 Immo Landwerth(https:// ...

  10. Java帖子

    IDEA新手使用教程(详解):https://cloud.tencent.com/developer/article/1448115 Java学习文档:https://www.sxt.cn/Java_ ...