zoukankan      html  css  js  c++  java
  • 2016.2.17文件夹选择框及文件选择框

    string fpth = "";

                OpenFileDialog openFileDialog = new OpenFileDialog();

                openFileDialog.Title = "请选择走向文件";

                openFileDialog.Filter = "文本文件|*.txt";

     

                openFileDialog.RestoreDirectory = true;

                if (openFileDialog.ShowDialog() == DialogResult.OK)

                {

                    fpth = openFileDialog.FileName;

                }

     

                if (fpth == "") return;

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                FolderBrowserDialog folderDlg = new FolderBrowserDialog();

                folderDlg.ShowNewFolderButton = false;

                folderDlg.SelectedPath = Directory.GetCurrentDirectory();

                folderDlg.Description = "选择脚本sql文件存放路径";

                if (folderDlg.ShowDialog() == DialogResult.OK)

                {

                    tb_sqlpath.Text = folderDlg.SelectedPath;

                    Common.APPConfig.GetAPPConfig().SetConfigValue("SqlFilePath", tb_sqlpath.Text);

                }

    同时选多种后缀用;隔开:openFileDialog.Filter = "Excel|*.xls;*.xlsx";

  • 相关阅读:
    wrk压测工具使用
    Mac 抓包工具wireshark使用
    hadoop无法停止
    非root用户如何使用docker命令
    too many open files
    kafka性能测试1.0.0
    命令查看linux主机配置
    ELK(Logstash+Elasticsearch+Kibana)的原理和详细搭建
    分布式session实现
    NUC972裸机调试步骤
  • 原文地址:https://www.cnblogs.com/mol1995/p/5964958.html
Copyright © 2011-2022 走看看