码迷,mamicode.com
首页 > 其他好文 > 详细

2016.2.17文件夹选择框及文件选择框

时间:2016-10-15 19:05:21      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:

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;

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

            }

2016.2.17文件夹选择框及文件选择框

标签:

原文地址:http://www.cnblogs.com/mol1995/p/5964958.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!