本文介绍了C#获取文件夹中的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我想在partiular文件夹exp:D:\ testfol中列出子文件夹中的所有文件,子文件夹,文件,并在列表框中添加。是否有可能??
如果可能的话可以提供一些例子?
谢谢,
hi guys, i wanna to list all files, subfolder, files inside subfolder at partiular folder exp: D:\testfol and add in listbox. is it possible??
if possible can provide some example??
thanks,
推荐答案
foreach (System.IO.FileInfo fi in new System.IO.DirectoryInfo("D:\\testfol").GetFiles("*.*", System.IO.SearchOption.AllDirectories)
{
// do something
}
这篇关于C#获取文件夹中的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!