File System List With System.IO

This tutorial is more a code sample than a tutorial, but we can’t create an online example of it due to security issues.

Basically, what you see here is a use of the System.IO namespace to get the file structure of your PC. To get the list of Logical Drives, we use the GetLogicalDrives method. From there, click on the drive you want to get the file structure of that drive. It will list the folders and files from that drive. Naturally, like Explorer, you can drill down as far as you wish here. As you will also see, we show how to display certain files, depending on the file’s extension. In this case, we use GIF or JPG files. Each of them should show up as a link. Click on that link and it will open a new window with that image. To download the images used in this tutorial, use these images ( –  – ) and put them in an images folder.

Continues…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>