I'm trying to find a fast way to populate a TreeView in C# on Windows using a path from a string as the depth.
I am already running a method that collect me all the items out of a Directory and ist subdirectories. This is what I get back when I start my method
C:\Users\Marco Reisacher\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessibility\Magnify.lnk
C:\Users\Marco Reisacher\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessibility\Narrator.lnk
C:\Users\Marco Reisacher\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessibility\On-Screen Keyboard.lnk
C:\Users\Marco Reisacher\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk
C:\Users\Marco Reisacher\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Notepad.lnk
I want my treeview to look like this (language is german here, but that doesn't matter)
Is there any simple way of like substringing/extracting the single directories and add the nodes that way?