Hello, i want to populate a treeview with the directorys from my pc,
how i do that?

Recommended Answers

All 2 Replies

You will need to start with node of the C: drive and then call a recursive function that would receive in parameter a TreeNode (that will keep building after each recursive calls) and a DirectoryInfo. If the item in the directory is not a folder simply add it (supposing that you dont want only folders) and if its a directory than Call again the recursive function with new values.

that's very helpful, thanks
but how do i connect the first Node to C and from ther to all the other drives?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.