您的位置:首页 > 其它

FolderBrowserDialog提示用户选择文件夹滴

2013-12-16 09:59 489 查看
示例:
using (FolderBrowserDialog dialog = new FolderBrowserDialog())
{
dialog.Description = "请选择存放音乐的文件夹";
dialog.ShowNewFolderButton = false;

if (dialog.ShowDialog() != DialogResult.OK)
return;

this.SearchOneFolder(dialog.SelectedPath);
}
if (Directory.Exists(path))
{
string[] files = Directory.GetFiles(path, "*.mp3");
if (files != null && files.Length > 0)
{
foreach (var filePath in files)
{
string name = Path.GetFileName(filePath);
this.lvPCMusic.Items.Add(new ListViewItem(new string[] { name, filePath }) { Tag = filePath });

}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: