2

Hi all im trying to create a basic screen saver that has a screen split into two, the left hand side will be similar to the dos command tree where it lists all files and folders, the right hand side will be where the files contents are displayed. So when the application starts up the tree on the left is populated and then the application starts to go through all the files one by one opening them and scrolling through them if possible.

So here is where im stuck i cant seem to figure out how to print a directory tree to the screen.

It seems like a trivial question i know but i cant for the life of me find a solution as elegant as the dos command.

As always any help would be appreciated.

Brian Webster
  • 30,033
  • 48
  • 152
  • 225
crackruckles
  • 336
  • 2
  • 5
  • 21
  • You could get a Directory Output from C:\ through the My.Computer.Filesystem.getfiles-methods. It should return a list of all files – Christian Sauer Jan 09 '13 at 12:47
  • Take a recursive directory search http://stackoverflow.com/questions/929276/how-to-recursively-list-all-the-files-in-a-directory-in-c and modify it such that an integer is incremented when the function is executed and decremented when it returns, then within the function use that value as an indication of nesting indent to apply when you print to screen. – Alex K. Jan 09 '13 at 12:54
  • 2
    A screen saver that requires input and discloses information from files while the user is away. That's unusual. – Hans Passant Jan 09 '13 at 13:27
  • It doesnt require input at all it just keeps going from file to file scrolling through all the contents, what i want to do with it once i have this basic shell is to add a bunch of effects and animations so it doesnt actually show the real content but again thats a later step i first need to get the basics working. – crackruckles Jan 10 '13 at 05:34

1 Answers1

1

You can use the TreeView control to display the folders and files. Just populate it with the folder contents, recursively if necessary.

xpda
  • 15,585
  • 8
  • 51
  • 82