如何将所有文件添加到列表框? [英] How to add all files to listbox?

查看:105
本文介绍了如何将所有文件添加到列表框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种解决方案,将用户计算机上现有的所有文件添加到列表框中.如果用户选择C:\,我希望列表框尽快将所有文件夹和文件添加到列表框中.

I am looking for a solution that will add all files existing on a user computer to a listbox. If the user selects the C:\ I would like the listbox to add all folders and files to the listbox as quickly as possible. No other action is necessary at this point

推荐答案

如果您正在使用VB.NET,请查看DirectoryInfoFileSystemInfo类.您可以使用这些文件来获取所有文件,然后将它们添加到您的ListBox中.尝试使用Google遍历文件和目录列表的示例.
If you''re using VB.NET, take a look at the DirectoryInfo and FileSystemInfo classes. You can use those to get all the files and then add them to your ListBox. Try Google for examples of iterating through file and directory lists.


这篇关于如何将所有文件添加到列表框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆