在.net中使用树形视图查看计算机中的所有文件和目录 [英] using tree view in .net to view all files and directories in computer

查看:60
本文介绍了在.net中使用树形视图查看计算机中的所有文件和目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用树形视图显示所有计算机中的所有目录中的n个文件及其文件名及其属性n应显示的文件数????
有人可以帮我吗?

how to use tree view to show all directories n files in whole computer n along with file name its properties n number of files should be displayed???
can anyone plz help me out???

推荐答案

您需要编写一些代码来扫描目录树并获取每个目录中每个文件的详细信息.您可以在程序开始时执行此操作,尽管这可能是非常耗时的任务.一种更好的方法(也是我已经实现的一种方法)是从仅包含系统上磁盘驱动器的树开始.然后,当用户单击磁盘时,您可以展开树以包括所有顶级目录.在扩展目录时重复此过程,您应该能够很快看到树的任何部分.当树折叠时,您可以根据需要丢弃或缓存数据.
You need to write some code to scan through your directory trees and get the details of each file in each directory. You can do this at the beginning of your program, although that can be a very time consuming task. A slightly better way (and one that I have implemented) is to start with the tree containing only the disk drives on your system. Then as the user clicks on a disk you can expand the tree to include all the top level directories. Repeat this process as directories are expanded and you should be able to see any part of the tree fairly quickly. When trees are collapsed you can discard or cache the data as required.


这篇关于在.net中使用树形视图查看计算机中的所有文件和目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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