Click here to Skip to main content
15,895,746 members
Articles / Programming Languages / XML
Article

Disk Size Explorer

Rate me:
Please Sign up or sign in to vote.
4.66/5 (25 votes)
29 Mar 20051 min read 103.8K   2.3K   89   18
Disk size explorer scans local disks and displays the size of each directory and subdirectory. Selecting a tree node will display the size in a pie chart. Users can drill through the explorer using the treeview or pie chart.

Image 1

Introduction

DiskSize is a program to scan a local drive and display the results in a treeview and on a 3D pie chart. It uses only the .NET Framework and Windows API functions, no third party products.

After scanning your local drive, the results are both displayed and cached in an XML file. Refreshing the entire drive or a single subdirectory will result in updating the cache. Subsequent loads will load from the cache.

The Explorer interface provides drill down functionality using either the treeview or the pie chart. A context menu is displayed which allows rescanning, exploring and opening directories and drives. This application uses a string resource file so it can be easily internationalized.

Points of interest

Demonstrated in this application are the following:

  • Iterating through the file system and storing the results in XML.
  • Saving and loading XML.
  • Binding a TreeView to XML.
  • Creating a 3D Pie chart with pie slice highlighting and selection.
  • Custom sorting by implementing the IComparable interface.
  • Implementing a drop-down list in a toolbar.
  • Binding lists to custom name-value pairs.
  • Internationalizing an application.

Background

I've wanted an application like this for some time. It is very helpful if disk space is limited and you want to quickly find out where your disk space has gone. I find myself now cheating and using the pie chart to navigate around my machine and then selecting open when I am at the directory I am looking for.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
Troy Gleason has been programming for over 15 years. Programming languages include ASP, ASP.NET, C#, Java, JavaScript, and VB (in alphabetical order) as well as DHTML, XML, and related technologies. Troy is currently a principal at International Network Services (INS)

Comments and Discussions

 
Questiondoes not work need to work on debugging Pin
Nikhil Goswami29-Sep-12 9:21
Nikhil Goswami29-Sep-12 9:21 
GeneralNot much to the article, but the application is nice Pin
Shane Story29-Dec-08 11:04
Shane Story29-Dec-08 11:04 
GeneralDivide by zero Pin
heberts_tkd8-Mar-07 8:53
heberts_tkd8-Mar-07 8:53 
GeneralAwsome!!!!! Pin
breech15-Apr-06 14:11
breech15-Apr-06 14:11 
GeneralGreat!! Solved my problem... Pin
Wcohen20-May-05 2:42
Wcohen20-May-05 2:42 
GeneralChanges for VS2005 Pin
BitBanger12-Apr-05 15:57
BitBanger12-Apr-05 15:57 
GeneralRe: Changes for VS2005 Pin
Troy Gleason13-Apr-05 4:21
Troy Gleason13-Apr-05 4:21 
QuestionZIP has no files...again? Pin
kutyafal8-Apr-05 3:22
kutyafal8-Apr-05 3:22 
AnswerRe: ZIP has no files...again? Pin
Troy Gleason11-Apr-05 4:20
Troy Gleason11-Apr-05 4:20 
GeneralSuggestions Pin
Alexander M.,7-Apr-05 4:50
Alexander M.,7-Apr-05 4:50 
I have a suggestion how to improve your application.
It is about the pie diagram, which also shows very small directories.
Most people will use this software to see what directories are wasting their disk space to get the chance to delete unnecessary files.
You should change the pie diagram, so that only directories with more than 5% are get listed and the smaller ones get combined to just one chunk.

Don't try it, just do it! Wink | ;-)
GeneralRe: Suggestions Pin
Troy Gleason11-Apr-05 4:25
Troy Gleason11-Apr-05 4:25 
Generalsomething similar Pin
Razmar29-Mar-05 19:34
Razmar29-Mar-05 19:34 
GeneralRe: something similar Pin
Uwe Keim30-Mar-05 6:19
sitebuilderUwe Keim30-Mar-05 6:19 
GeneralRe: something similar Pin
Troy Gleason6-Apr-05 10:13
Troy Gleason6-Apr-05 10:13 
GeneralRe: something similar Pin
Razmar6-Apr-05 20:36
Razmar6-Apr-05 20:36 
GeneralRe: something similar Pin
Peter Schatz5-Jul-07 3:27
Peter Schatz5-Jul-07 3:27 
Generalzip file have no files Pin
Saurabh.Garg29-Mar-05 14:02
Saurabh.Garg29-Mar-05 14:02 
GeneralRe: zip file have no files Pin
Troy Gleason29-Mar-05 14:34
Troy Gleason29-Mar-05 14:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.