Thursday, April 24, 2008

Simple Windows Explorer by C#

This is simple software like Windows Explorer. Of course it’s very simple but in this sample I have covered usage of some of the classes in System.IO namespace such as Path, FileInfo, DriveInfo, FileSystemWatcher, DirectoryInfo.

TreeView is loading it’s nodes On Demand which is an applicable way used in real applications। If you double click on a text file it will be opened in a new window which. I have used StreamReader and StreamWriter classes to implement reading/writing text files. Other file type will be opened by a BinaryReader for you to show the Binary data inside them.

Please let me know if there any error or question within this sample.


BmmB said...

Very very very... very basic.
You could invest a minute more to make it open all files in their default programs (as it should be).
And you should make it possible to open folders from list view, and update the tree view as needed.
As you didn't implemented those two things mentioned, your windows explorer clone is not worth a bit.

Best regards...

Anonymous said...

BmmB must have over looked that fact that this is a SAMPLE. In no means is it meant to be beta or a Freeware application. It is sample showing how to use System.IO in C#.

Masoud thank you for the sample.

Anonymous said...

Good sample ! If you want greater adherence to the Windows Explorer look (rooted at Desktop, shows items like Cntrol Panel, etc), you can do the same thing by using the shell interfaces like IShellFolder, IShellView, etc. Or you can use a control such as FolderView (

Anonymous said...

The download link is down =(