日期:2014-05-20 浏览次数:20843 次
FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); if(folderBrowserDialog.ShowDialog(this) == DialogResult.OK) { fullDirectoryName = folderBrowserDialog.SelectedPath; directoryName = Path.GetDirectoryName(fullDirectoryName); this.txt_DireName.Text = fullDirectoryName; }
this.txt_DireName.Text = new System.IO.DirectoryInfo(folderBrowserDialog.SelectedPath).Name;
------解决方案--------------------
DirectoryInfo 类的操作