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;
?????? ?????????NavChina.Common.APPConfig.GetAPPConfig().SetConfigValue("SqlFilePath", tb_sqlpath.Text);
??????????? }
轉載于:https://www.cnblogs.com/mol1995/p/5964958.html
總結
以上是生活随笔為你收集整理的2016.2.17文件夹选择框及文件选择框的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HTTPS证书撤销
- 下一篇: 【noi 2.6_9284】盒子与小球之