将目录信息和文件信息存储在通用列表中 [英] Store directory info and file info in generic list

查看:73
本文介绍了将目录信息和文件信息存储在通用列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



在我的一个应用程序中我想通过winforms显示远程计算机中存在的目录,子目录和文件。是否有任何控制来完成这个?



并且在将它填充到控件之前我想在列表中存储dir,subdir和files的信息。我正在研究自定义的课程列表,但是失败了......对于这个问题还有其他解决办法吗?



谢谢你

解决方案

为了存储子目录,你必须使用适当的重载来读取所有文件,或者安排你的Dir类来存储分层信息(通过包含Dir实例列表)并递归地解析文件夹以构建信息。



但是,您无论如何都不一定能够访问远程文件和文件夹 - 在正常情况下只能使用公共共享文件夹。

hello

in one of my application i want to show the directories, sub directories and files which is present in a remote computer through winforms. is ther any control to accomplish this ??

and also before populating it to a controll i would like to store the info of dir, subdir and files in list. i am working on custom list of classes but failed.. is ther any alternate solution for this ??

thank u

解决方案

In order to store subdirectories, you have to use the appropriate overload which reads all files, or arrange your Dir class to both store hierarchical information (by containing a list of Dir instances) and recursively parse the folders to build up the information.

However, you will not necessarily be able to access the remote files and folders anyway - only public shared folders are available under normal circumstances.


这篇关于将目录信息和文件信息存储在通用列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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