标签:分享图片 .text play closed select xls 文件管理 close dia
打开文件夹中默认路径下的excl文件
private void button7_Click(object sender, EventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd.SelectedPath = "D:";//默认打开d盘 if (fbd.ShowDialog() == DialogResult.OK) { textBox1.Text = fbd.SelectedPath; DirectoryInfo dif = new DirectoryInfo(textBox1.Text); FileInfo[] fis = dif.GetFiles();//取所有文件信息 foreach (FileInfo fi in fis) { if (fi.Name.ToLower().Contains(".xls") || fi.Name.ToLower().Contains(".xlsx")) { listView1.Items.Add(fi.Name); } } } }
C# winform (FolderBrowserDialog)文件管理
标签:分享图片 .text play closed select xls 文件管理 close dia
原文地址:https://www.cnblogs.com/SoftWareIe/p/10202155.html