Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I need help on how to map my drives into a tree view. I can get my drives to show but I can not get all the sub directories. I would like to get my entire drive mapped out into a tree view. Any help would be appreciated. This is what I got so far.

C#
string[] drives = Environment.GetLogicalDrives();
            foreach (string dr in drives)
            {
                TreeNode node = new TreeNode(dr);
                node.Tag = dr;
                treeView1.Nodes.Add(node);
            }
            treeView1.CollapseAll();
Posted

1 solution

See if Filesystem TreeView[^] helps.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Mar-11 20:47pm    
Thank you for pointing this article, my 5.
The code is pretty trivial, but I don't have anything which is good enough for demonstration of this technique. And imagine 2 or 3 times I tried to explain exactly the same technique (mind you: virtualization and fake nodes...) with just words and a development work flow with items. With this reference. If I had this reference...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900