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";

  • 相关阅读:
    网络编程总结
    网络编程进阶---->>> hamc模块 socketserver模块验证合法性 两者进行通信连接
    黏包
    socket概念 套接字
    网络协议
    python之路——网络基础
    模块复习 staticmethod和classmethod的区别
    Dubbo执行流程?
    Dubbo在安全机制方面是如何解决的
    Dubbo中有哪些角色?
  • 原文地址:https://www.cnblogs.com/mol1995/p/5964958.html
Copyright © 2011-2022 走看看